<template>
    <div class="app-container" v-loading="isloading" element-loading-text="正在下载中..."
        element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
        <el-row :gutter="20" style="margin-bottom:10px;position: absolute;bottom: 10px;left: 50px;z-index: 99;" v-if="this.quanxian == false">
            <el-col style="display: flex;" :data="xinxi">
                <span style="font-size: 14px;color: #4E5969;font-weight: 600;">全部客资数量:{{ xinxi.quanbukz }}</span>
                <el-divider direction="vertical"></el-divider>
                <span style="font-size: 14px;color: #4E5969;font-weight: 600;">活动锁单率:{{ xinxi.duodan }}%</span>
                <el-divider direction="vertical"></el-divider>
                <span style="font-size: 14px;color: #4E5969;font-weight: 600;">订单转化率:{{ xinxi.dingdan }}%</span>
                <el-divider direction="vertical"></el-divider>
                <span style="font-size: 14px;color: #4E5969;font-weight: 600;">客资退回率:{{ xinxi.kezituihui }}%</span>
                <el-divider direction="vertical"></el-divider>
                <span style="font-size: 14px;color: #4E5969;font-weight: 600;">退单率:{{ xinxi.tuidan }}%</span>
            </el-col>
        </el-row>
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
            <el-form-item label="时间范围" style="width:400px;margin-right: 220px;">
                <el-date-picker v-model.trim="queryParams.startTime" type="date" value-format="timestamp"
                    :picker-options="startDatePicker" placeholder="开始时间" style="width: 150px">
                </el-date-picker>
                <el-date-picker v-model.trim="endTimes" type="date" value-format="timestamp" :picker-options="endDatePicker"
                    placeholder="结束时间" style="width: 150px">
                </el-date-picker>
            </el-form-item>
            <!-- <el-form-item label="客资姓名" prop="kzname" style="width:300px">
                <el-input v-model="queryParams.kzname" placeholder="请输入客资姓名" clearable style="width: 180px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item> -->
            <el-form-item label="客资ID" prop="kzid" style="width:300px">
                <el-input v-model="queryParams.kzid" placeholder="请输入客资ID" clearable style="width: 180px"
                    onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="微信号" prop="kzwechat" style="width:300px">
                <el-input v-model="queryParams.kzwechat" placeholder="请输入微信号" clearable style="width: 180px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="联系方式" prop="kztel" style="width:300px"
                :rules="[{ pattern: /^[0-9]*$/, message: '请输入正确的手机号码', trigger: 'blur' }]">
                <el-input v-model="queryParams.kztel" placeholder="请输入联系方式" clearable style="width: 180px"
                    onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" @keyup.enter.native="handleQuery" />
            </el-form-item>
            <!-- <el-form-item label="省份" prop="sheng" style="width:300px">
                <el-input v-model="queryParams.sheng" placeholder="请输入省份" clearable style="width: 180px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="市级" prop="shi" style="width:300px">
                <el-input v-model="queryParams.shi" placeholder="请输入市级" clearable style="width: 180px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item> -->
            <el-form-item label="客资分类" prop="servetype" v-if="this.quanxian == false" style="width:300px">
                <el-select v-model="queryParams.servetype" placeholder="请选择" clearable style="width: 180px">
                    <el-option v-for="dict in servetype" :key="dict.key" :label="dict.label" :value="dict.label" />
                </el-select>
            </el-form-item>
            <el-form-item label="意向城市" style="width:300px">
                <el-cascader
                    size="mini"
                    :options="pcaTextArr"
                    v-model="selectedOptions1">
                </el-cascader>
            </el-form-item>
            <el-form-item label="所在城市" style="width:300px">
                <el-cascader
                    size="mini"
                    :options="pcaTextArr"
                    v-model="selectedOptions2">
                </el-cascader>
            </el-form-item>
            <el-form-item label="客资来源" prop="kzfrom" v-if="this.quanxian == false" style="width:300px">
                <el-select v-model="queryParams.kzfrom" placeholder="用户状态" clearable style="width: 180px">
                    <el-option v-for="dict in kzfrom" :key="dict.key" :label="dict.label" :value="dict.label" />
                </el-select>
            </el-form-item>
            <!-- 无效--0 有效--1 -->
            <el-form-item label="审核状态" prop="ynyouxiao" v-if="this.quanxian == false " style="width:300px">
                <el-select v-model="queryParams.ynyouxiao" placeholder="是否有效" clearable style="width: 180px">
                    <el-option v-for="dict in kztype" :key="dict.value" :label="dict.label" :value="dict.value" />
                </el-select>
            </el-form-item>
            <el-form-item label="跟进类型" prop="ynfenpei" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-select v-model="queryParams.ynfenpei" placeholder="请输入" clearable style="width: 180px">
                    <el-option v-for="dict in genjin" :key="dict.key" :label="dict.label" :value="dict.value" />
                </el-select>
            </el-form-item>
            <el-form-item label="客资深挖" prop="wuxiao" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-select v-model="queryParams.kzsw" placeholder="请输入" clearable style="width: 180px">
                    <el-option v-for="dict in remark" :key="dict.key" :label="dict.label" :value="dict.label" />
                </el-select>
            </el-form-item>
            <el-form-item label="退单类型" prop="td" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-select v-model="queryParams.td_type" placeholder="请输入" clearable style="width: 180px">
                    <el-option v-for="dict in td_type" :key="dict.key" :label="dict.label" :value="dict.label" />
                </el-select>
            </el-form-item>
            <el-form-item label="报单类型" prop="bd" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-select v-model="queryParams.bd_type" placeholder="请输入" clearable style="width: 180px">
                    <el-option v-for="dict in bd_type" :key="dict.key" :label="dict.label" :value="dict.label" />
                </el-select>
            </el-form-item>
            <el-form-item label="操作员" prop="czy" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-select v-model="queryParams.czy" placeholder="请输入" clearable style="width: 180px">
                    <el-option v-for="dict in paidanList" :key="dict.userid" :label="dict.nickName" :value="dict.userid" />
                </el-select>
            </el-form-item>
            <el-form-item label="其他搜索" prop="o_search" v-if="this.quanxian == false && showOtherFilter" style="width:100%;">
                <el-autocomplete
                v-model="otherState"
                :fetch-suggestions="querySearchAsync"
                placeholder="请输入员工姓名、员工ID、商家名称"
                @select="handleSelect" style="width: 313px;"
                ></el-autocomplete>
            </el-form-item>

            <!-- <el-form-item label="退单类型" prop="nickname" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-input v-model="queryParams.nickname" placeholder="请输入" clearable style="width: 180px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item> -->
            <!-- <el-form-item label="员工ID" prop="userid" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-input v-model="queryParams.userid" placeholder="请输入录入员工id" clearable style="width: 180px"
                    onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="分配商家名" prop="shopfenpei" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-input v-model="queryParams.shopfenpei" placeholder="请输入分配商家名" clearable style="width: 180px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item> -->
            <!-- <el-form-item label="预约婚期" prop="kzwedding" style="width:300px">
                <el-select v-model="queryParams.kzwedding" placeholder="预约婚期" clearable style="width: 180px">
                    <el-option v-for="dict in kzWedding" :key="dict.key" :label="dict.label" :value="dict.label" />
                </el-select>
            </el-form-item> -->
            <!-- <el-form-item label="是否分配商家" prop="ynshops" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-select v-model="queryParams.ynshops" placeholder="是否分配商家" clearable style="width: 180px">
                    <el-option v-for="dict in fenpei" :key="dict.key" :label="dict.label" :value="dict.value" />
                </el-select>
            </el-form-item>
            <el-form-item label="客资姓名是否为空" prop="ynname" v-if="this.quanxian == false && showOtherFilter" style="width:400px">
                <el-select v-model="queryParams.ynname" placeholder="客资姓名是否为空" clearable style="width: 180px">
                    <el-option v-for="dict in fenpei" :key="dict.value" :label="dict.label" :value="dict.value" />
                </el-select>
            </el-form-item> -->
            <!-- <el-form-item label="是否有截图" prop="ynpic" style="width:300px">
                <el-select v-model="queryParams.ynpic" placeholder="是否有截图" clearable style="width: 180px">
                    <el-option v-for="dict in fenpei" :key="dict.value" :label="dict.label" :value="dict.value" />
                </el-select>
            </el-form-item> -->
            <!-- v-if="this.quanxian == false" -->
            <!-- <el-form-item label="客资状态" prop="fid" style="width:300px" v-if="showOtherFilter">
                <el-select v-model="queryParams.fid" placeholder="请输入客资状态" clearable style="width: 180px">
                    <el-option v-for="dict in kzzhuangtai" :key="dict.value" :label="dict.label" :value="dict.value" />
                </el-select>
            </el-form-item>
            <el-form-item label="分配商户数" prop="shopnum" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-input v-model="queryParams.shopnum" placeholder="分配商户数" clearable style="width: 180px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="派单员" prop="paidanname" v-if="this.quanxian == false && showOtherFilter" style="width:300px">
                <el-select v-model="queryParams.paidanname" placeholder="派单员" clearable style="width: 180px">
                    <el-option v-for="(item, index) in paidanList" :key="index" :label="item" :value="item" />
                </el-select>
            </el-form-item>
            <el-form-item label="派单时间" style="width:400px" v-if="this.quanxian == true && showOtherFilter">
                <el-date-picker v-model.trim="queryParams.pdstarttime" type="date" value-format="timestamp"
                    :picker-options="startDatePicker" placeholder="开始时间" style="width: 150px">
                </el-date-picker>
                <el-date-picker v-model.trim="queryParams.pdendtime" type="date" value-format="timestamp"
                    :picker-options="endDatePicker" placeholder="结束时间" style="width: 150px">
                </el-date-picker>
            </el-form-item> -->
            <el-form-item style="margin-left:100px;width: 100%;">
                <el-button type="primary" size="mini" v-hasPermi="['kuser:allkz:query']"
                    @click="handleQuery">查询
                </el-button>
                <el-button size="mini" @click="resetQuery">重置</el-button>
                <div style="font-size: 14px;color: #5672FA;display: inline-block;margin-left: 50px;cursor: pointer;">
                    <div v-if="!showOtherFilter" @click="showOtherFilter = true">
                        <span>展开更多</span><i class="el-icon-arrow-down"></i>
                    </div>
                    <div v-if="showOtherFilter" @click="showOtherFilter = false">
                        <span>收起</span><i class="el-icon-arrow-up"></i>
                    </div>
                </div>
            </el-form-item>
        </el-form>
        <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
                <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
                    v-hasPermi="['kuser:allkz:add']">新增</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
                    v-hasPermi="['kuser:allkz:export']">导出</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
                    v-hasPermi="['system:user:import']">导入</el-button>
            </el-col>
            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
        <el-table v-loading="loading" :data="resourceList" @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="客资ID/来源" align="center" width="120">
                <template slot-scope="scope">
                    <div>ID：{{ scope.row.kzid }}</div>
                    <div>来源：{{scope.row.kzfrom}}</div>
                </template>
            </el-table-column>
            <!-- <el-table-column label="客资编号" align="center" prop="kzresource" /> -->
            <!-- <el-table-column label="客资姓名" align="center" prop="kzname" /> -->
            <el-table-column label="联系方式" align="center" v-if="this.quanxian == false" width="150">
                <template slot-scope="scope">
                    <div>手机号：{{ scope.row.kztel }}</div>
                    <div>微信号：{{scope.row.kzwechat}}</div>
                </template>
            </el-table-column>
            <!-- <el-table-column label="微信号" align="center" prop="kzwechat" v-if="this.quanxian == false" /> -->
            <el-table-column label="客资分类/入库人" align="center">
                <template slot-scope="scope">
                    <div>分类：{{ scope.row.servetype }}</div>
                    <div>入库人：{{scope.row.nickname}}</div>
                </template>
            </el-table-column>
            <el-table-column label="城市" align="center" width="220">
                <template slot-scope="scope">
                    <div>所在城市：{{ scope.row.kzInWantCity }}</div>
                    <div>意向城市：{{scope.row.wantcity}}</div>
                </template>
            </el-table-column>
            <el-table-column label="入库时间" align="center" prop="kzcreatetime" v-if="this.quanxian == false">
                <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.kzcreatetime, '{YY}-{MM}-{DD} {hh}:{mm}:{ss}') }}</span>
                </template>
            </el-table-column>
            <el-table-column label="客资状态" align="center" type="text" >
              <template slot-scope="scope">
                <span>{{checkKzType(scope.row.typeid) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="最近平台备注" align="center" v-if="this.quanxian == false">
                <template slot-scope="scope">
                    <div>备注内容：{{ scope.row.remark }}</div>
                    <div>备注账号：{{scope.row.remarkAccount}}</div>
                </template>
            </el-table-column>
            <el-table-column label="备注时间" align="center" prop="kzcreatetime" v-if="this.quanxian == false" >
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.kzcreatetime, '{YY}-{MM}-{DD} {hh}:{mm}:{ss}') }}</span>
              </template>
            </el-table-column>
            <!-- <el-table-column label="客资来源" align="center" prop="kzfrom" v-if="this.quanxian == false" />
            <el-table-column label="派单时间" align="center" prop="newtime" v-if="this.quanxian == true" />
            <el-table-column label="员工姓名" align="center" prop="nickname" v-if="this.quanxian == false">
                <template slot-scope="scope">
                    <p>{{ scope.row.nickname }}</p>
                    <p>{{ scope.row.userid }}</p>
                </template>
            </el-table-column>
            <el-table-column label="审核状态" align="center" prop="typeid" v-if="this.quanxian == false">
                <template slot-scope="scope">
                    <span v-if="scope.row.typeid == 2">无效</span>
                    <span v-else-if="scope.row.typeid == 0">待审核</span>
                    <span v-else>有效</span>
                </template>
            </el-table-column> -->
            <el-table-column label="分配商家" align="center" prop="resourceList.list.shopname" valian="middle" width="150px"
                v-if="this.quanxian == false">
                <!-- 点击查看分配商家列表 -->
                <template slot-scope="scope">
                    <el-row class="block-col-2">
                        <el-col :span="150" style="width: 100%;">
                            <p v-if="scope.row.allShopnamePuname.length == 0" style="text-align: center;">未分配商家</p>
                            <div v-else>
                                <el-button @click="handleshop(item.shopid, scope.row)" type="text"
                                    style="width: 150px;margin-left: -10px;"
                                    v-for="item in scope.row.allShopnamePuname.slice(0, 5)" :key="item.shopid">{{
                                        item.shopname }}
                                    <span>{{ item.typename }}</span>
                                </el-button>
                                <el-dropdown trigger="click" v-if="scope.row.allShopnamePuname.length > 5">
                                    <span class="el-dropdown-link">
                                        点击查看已分配商家<i class="el-icon-arrow-down el-icon--right"></i>
                                    </span>
                                    <el-dropdown-menu slot="dropdown">
                                        <el-dropdown-item>
                                            <!-- <span v-if="scope.row.allShopnamePuname.length == 0">未分配商家</span> -->
                                            <el-button v-hasPermi="['kuser:allkz:shopkz']"
                                                @click="handleshop(item.shopid, scope.row)" type="text"
                                                style="width: 130px;" v-for="item in scope.row.allShopnamePuname.slice(5)"
                                                :key="item.shopid">
                                                <span>{{ item.shopname }}</span><span>{{ item.typename }}</span>
                                            </el-button>
                                        </el-dropdown-item>
                                    </el-dropdown-menu>
                                </el-dropdown>
                            </div>
                        </el-col>
                    </el-row>
                </template>
            </el-table-column>
            <!-- <el-table-column label="派单员" align="center" valian="middle" prop="resourceList.list.paidanname"
                v-if="this.quanxian == false" width="150px">
                <template slot-scope="scope">
                    <el-row class="block-col-2">
                        <el-col :span="150" style="width: 100%;">
                            <span v-if="scope.row.allShopnamePuname.length == 0" style="text-align:center;">暂无</span>
                            <div v-else>
                                <span @click="handleshop(item.shopid, scope.row)" type="text" style="width: 130px;"
                                    v-for="item in scope.row.allShopnamePuname.slice(0, 5)" :key="item.shopid">
                                    <p style="height:35px ;">{{ item.paidanname }}</p>
                                </span>
                                <el-dropdown trigger="click" v-if="scope.row.allShopnamePuname.length > 5">
                                    <span class="el-dropdown-link">
                                        点击查看派单员<i class="el-icon-arrow-down el-icon--right"></i>
                                    </span>
                                    <el-dropdown-menu slot="dropdown">
                                        <el-dropdown-item>
                                            <el-button @click="handleshop(item.shopid, scope.row)" type="text"
                                                style="width: 130px;" v-for="item in scope.row.allShopnamePuname.slice(5)"
                                                :key="item.shopid">
                                                <p>{{ item.paidanname }}</p>
                                            </el-button>
                                        </el-dropdown-item>
                                    </el-dropdown-menu>
                                </el-dropdown>
                            </div>
                        </el-col>
                    </el-row>
                </template>
            </el-table-column>
            <el-table-column label="凭证或图片" align="center" prop="kzVoucherPic" v-if="this.quanxian == false">
                <template slot-scope="scope">
                    <div v-for="(item, index) in scope.row.kzVoucherPic">
                        <span v-if="scope.row.kzVoucherPic == '暂无'">{{ '暂无' }}</span>
                        <span v-else-if="scope.row.kzVoucherPic == ''">{{ '暂无' }}</span>
                        <el-image v-else :src="item" :key="index" alt="" weight="20" style="width:40px;"
                            :preview-src-list="srcList_L" @click="look(scope.row)">
                        </el-image>
                    </div>
                </template>
            </el-table-column> -->
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                <template slot-scope="scope">
                    <!-- <el-button size="mini" type="text" v-hasPermi="['kuser:allkz:look']" icon="el-icon-edit"
                        @click="handlelook(scope.row)">查看
                    </el-button> -->
                    <div style="display: flex;justify-content: center;align-items: center;">
                        <div style="display: flex;align-items: center;color: #23BB7B;margin-right: 10px;cursor: pointer;" @click="handlelook(scope.row)">
                            <img src="@/assets/images/detail.png" style="width: 13px;height: 13px;" alt="">
                            <div>查看</div>
                        </div>
                        <div style="display: flex;align-items: center;color: #FF7D00;margin-right: 10px;cursor: pointer;" @click="youxiaoshenhe(scope.row)" v-if="scope.row.typeid == 0">
                            <img src="@/assets/images/shenhe.png" style="width: 13px;height: 13px;" alt="">
                            <div>审核</div>
                        </div>
                        <div style="display: flex;align-items: center;color: #5672FA;cursor: pointer;" @click="kzfenpeishangjia(scope.row)" v-if="scope.row.typeid != 2 && scope.row.typeid != 0 && quanxian == false">
                            <img src="@/assets/images/fenpei.png" style="width: 13px;height: 13px;" alt="">
                            <div>分配客资</div>
                        </div>
                    </div>
                    <!-- <el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['kuser:allkz:edit']"
                        @click="handleUpdate(scope.row)">修改
                    </el-button> -->
                    <!-- v-if="scope.row.kztype == 0" -->
                    <!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="youxiaoshenhe(scope.row)"
                        v-if="scope.row.typeid == 0" v-hasPermi="['kuser:allkz:shenhe']">审核
                    </el-button>
                    <el-button size="mini" type="text" icon="el-icon-edit" @click="kzfenpeishangjia(scope.row)"
                        v-if="scope.row.typeid != 2 && scope.row.typeid != 0 && quanxian == false"
                        v-hasPermi="['kuser:allkz:fenpeikz']">分配客资
                    </el-button>
                    <el-button size="mini" type="text" icon="el-icon-edit" v-if="quanxian == true"
                        @click="handdleChakan(scope.row)">跟进记录
                    </el-button> -->
                </template>
            </el-table-column>
        </el-table>
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
            @pagination="getList" />
        <!-- 添加修改对话框 -->
        <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @close="close">
            <el-form ref="form" :model="form" :rules="rules" label-width="110px">
                <el-form-item label="客资姓名" prop="kzName" style="width:400px">
                    <el-input v-model="form.kzName" placeholder="请输入客资姓名" style="width:204px" />
                </el-form-item>
                <el-form-item label="联系方式" prop="kzTel"
                    :rules="form.kzWechat ? [{ required: false, pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }] : [{ required: true, pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }]">
                    <el-input maxlength="11" v-model.trim="form.kzTel" placeholder="请输入联系方式" />
                </el-form-item>
                <!-- pattern:/^[a-zA-Z]([-_a-zA-Z0-9]{5,20})$/ -->
                <!-- pattern:/^[^\u4e00-\u9fa5]*$/ -->
                <el-form-item label="微信号" prop="kzWechat" style="width:400px"
                    :rules="form.kzTel ? [{ required: false }] : [{ required: true, pattern: /^[^\u4e00-\u9fa5]*$/, message: '请输入正确的微信号', trigger: 'blur' }]">
                    <el-input v-model="form.kzWechat" placeholder="请输入微信号" style="width:204px" />
                </el-form-item>
                <el-form-item label="客资来源" prop="kzFrom">
                    <el-input v-model="form.kzFrom" placeholder="后台录入" :disabled="edit" />
                </el-form-item>
                <el-form-item label="服务种类" prop="serveType" style="width:400px">
                    <el-select v-model="form.serveType" placeholder="请输入服务种类" clearable style="width: 204px">
                        <el-option v-for="dict in serveType" :key="dict.key" :label="dict.label" :value="dict.label" />
                    </el-select>
                </el-form-item>
                <!-- 1、三个月内 2、三到五月  3、一年以上 -->
                <el-form-item label="客资预计婚期" prop="kzWedding">
                    <el-select v-model="form.kzWedding" placeholder="请输入预计婚期" clearable style="width: 204px">
                        <el-option v-for="dict in kzWedding" :key="dict.key" :label="dict.label" :value="dict.label" />
                    </el-select>
                </el-form-item>
                <el-form-item label="服务城市1" prop="kzWantcity" style="width:400px">
                    <el-cascader filterable :disabled="edit1" size="large" ref="cascader" :options="options"
                        style="width:204px" v-model="selectedOptions" :props="defaultParams" @change="handleChange">
                    </el-cascader>
                </el-form-item>
                <el-form-item label="服务城市2" prop="kzWantcity1">
                    <el-cascader size="large" :disabled="edit1" filterable ref="cascader" :options="options" clearable
                        style="width:204px" :props="defaultParams" v-model="selectedOptions1" @change="handleChange1">
                    </el-cascader>
                </el-form-item>
                <el-form-item label="服务城市3" prop="kzWantcity2" style="width:400px">
                    <el-cascader size="large" :disabled="edit1" filterable ref="cascader" clearable :options="options"
                        style="width:204px" :props="defaultParams" v-model="selectedOptions2" @change="handleChange2">
                    </el-cascader>
                </el-form-item>
                <el-form-item label="备注" prop="kzRemark">
                    <el-input v-model="form.kzRemark" type="textarea" placeholder="备注"></el-input>
                </el-form-item>
                <el-form-item label="聊天及截图上传" prop="kzVoucherPic" style="width:300px">
                    <el-upload class="avatar-uploader" :action="imgUrl.url" accept=".jpg, .png" :headers="imgUrl.headers"
                        list-type="picture" :on-success="handlePreview" :file-list="fileList" :on-remove="handleRemove"
                        name="fileName">
                        <el-button size="small" type="primary">点击上传</el-button>
                    </el-upload>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" :disabled="lock" @click="submitForm">确 定</el-button>
                <el-button @click="cancel">取 消</el-button>
            </div>
        </el-dialog>
        <!-- 查看对话框 -->
        <el-dialog :title="title3" :visible.sync="open3" width="800px" append-to-body @close="close">
            <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="edit">
                <el-form-item label="客资姓名" prop="kzName" style="width:400px">
                    <el-input v-model="form.kzName" placeholder="请输入客资姓名" style="width:204px" />
                </el-form-item>
                <el-form-item label="联系方式" prop="kzTel">
                    <el-input maxlength="11" v-model="form.kzTel" placeholder="请输入联系方式" />
                </el-form-item>
                <el-form-item label="微信号" prop="kzWechat" style="width:400px">
                    <el-input v-model="form.kzWechat" placeholder="请输入微信号" style="width:204px" />
                </el-form-item>
                <el-form-item label="客资来源" prop="kzFrom">
                    <el-input v-model="form.kzFrom" placeholder="后台录入" :disabled="edit" />
                </el-form-item>
                <el-form-item label="服务种类" prop="serveType" style="width:400px">
                    <el-select v-model="form.serveType" placeholder="请输入服务种类" clearable style="width:204px">
                        <el-option v-for="dict in serveType" :key="dict.key" :label="dict.label" :value="dict.label" />
                    </el-select>
                </el-form-item>
                <!-- 1、三个月内 2、三到五月  3、一年以上 -->
                <el-form-item label="客资预计婚期" prop="kzWedding">
                    <el-select v-model="form.kzWedding" placeholder="请输入预计婚期" clearable style="width:204px">
                        <el-option v-for="dict in kzWedding" :key="dict.key" :label="dict.label" :value="dict.label" />
                    </el-select>
                </el-form-item>
                <el-form-item label="服务城市1" prop="kzWantcity" clearable style="width:400px">
                    <el-cascader size="large" ref="cascader" :options="options" v-model="selectedOptions"
                        style="width:204px" :props="defaultParams" @change="handleChange">
                    </el-cascader>
                </el-form-item>
                <el-form-item label="服务城市2" prop="kzWantcity1" clearable>
                    <el-cascader size="large" ref="cascader" :options="options" :props="defaultParams" style="width:204px"
                        v-model="selectedOptions1" @change="handleChange1">
                    </el-cascader>
                </el-form-item>
                <el-form-item label="服务城市3" prop="kzWantcity2" clearable style="width:400px">
                    <el-cascader size="large" ref="cascader" :options="options" :props="defaultParams" style="width:204px"
                        v-model="selectedOptions2" @change="handleChange2">
                    </el-cascader>
                </el-form-item>
                <el-form-item label="备注" prop="kzRemark">
                    <el-input v-model="form.kzRemark" type="textarea" placeholder="备注"></el-input>
                </el-form-item>
                <el-form-item label="聊天及截图上传" prop="kzVoucherPic" style="width: 450px;">
                    <el-upload class="avatar-uploader" :action="imgUrl.url" accept=".jpg, .png" :headers="imgUrl.headers"
                        style="width:204px" list-type="picture" :on-success="handlePreview1" :on-remove="handleRemove1"
                        name="fileName">
                        <el-button size="small" type="primary">点击上传</el-button>
                        <template #tip>
                            <ul class="el-upload-list el-upload-list--picture show">
                                <li v-for="(item, index) in fileList" class="el-upload-list__item is-success" tabindex="0">
                                    <el-image style="cursor: pointer;" :preview-src-list="srcList_s"
                                        @click="looks(item.url)" class="el-upload-list__item-thumbnail" :src="item.url">
                                    </el-image>
                                    <a class="el-upload-list__item-name">
                                        <i class="el-icon-document"></i>
                                        {{ item.name }}
                                    </a>
                                    <label class="el-upload-list__item-status-label">
                                        <i class="el-icon-upload-success el-icon-check"></i>
                                    </label>
                                    <!-- onRemove：删除已上传的图片文件 -->
                                    <!-- <i class="el-icon-close" @click="handleRemove(item, fileArr)"></i> -->
                                </li>
                            </ul>
                        </template>
                    </el-upload>
                </el-form-item>

            </el-form>
        </el-dialog>

        <!-- 跟进记录 -->
        <el-dialog :visible.sync="open6" :title="title" width="500px" append-to-body>
            <div class="block">
                <el-timeline :reverse="reverse">
                    <el-timeline-item :timestamp="timestampToTime(item.changetime)" placement="top"
                        v-for="(item, index) in jiLuList" :key="index">
                        <el-card>
                            <p>跟进状态:{{ zhaungtai(item.typeid) }}</p>
                            <p v-if="item.typeid != 0">跟进人:{{ item.name || '暂无' }}</p>
                            <p v-if="item.typeid == 2">锁单金额:{{ item.msg || '暂无' }}</p>
                            <p v-if="item.typeid == 2"> <span>锁单及凭证:</span>
                                <span v-for="(img1, index) in imgsuodan" :key="index">
                                    <span id="photo" v-if="imgsuodan != ''">
                                        <el-image class="image" :src="img1"
                                            style="width: 80px; height:80px;vertical-align:text-top; margin-left: 5px"
                                            :preview-src-list="srcList2" @click="look2(img1)" />
                                    </span>
                                    <span v-if="imgsuodan == ''">{{ '暂无' }}</span>
                                </span>
                            </p>
                            <p v-if="item.typeid == 2">备注:{{ item.remark || '暂无' }}</p>
                            <p v-if="item.typeid == 3">成交金额:{{ item.msg || '暂无' }}</p>
                            <p v-if="item.typeid == 3"> <span>成交凭证:</span>
                                <span v-for="(img2, index) in imgchengjiao" :key="index">
                                    <span id="photo" v-if="imgchengjiao != ''">
                                        <el-image class="image" :src="img2"
                                            style="width: 80px; height:80px;vertical-align:text-top;margin-left: 5px;"
                                            :preview-src-list="srcList2" @click="look4(img2)" />
                                    </span>
                                    <span v-if="imgchengjiao == ''">{{ '暂无' }}</span>
                                </span>
                            </p>
                            <p v-if="item.typeid == 3">备注:{{ item.remark || '暂无' }}</p>
                            <p v-if="item.typeid == 4">转让原因:{{ item.msg || '暂无' }}</p>
                            <p v-if="item.typeid == 4"> <span>转让凭证:</span>
                                <span v-for="(img3, index) in imgzhuanrang" :key="index">
                                    <span id="photo" v-if="imgzhuanrang != ''">
                                        <el-image class="image" :src="img3"
                                            style="width: 80px; height:80px;vertical-align:text-top;margin-left: 5px"
                                            :preview-src-list="srcList2" @click="look5(img3)" />
                                    </span>
                                    <span v-if="imgzhuanrang == ''">{{ '暂无' }}</span>
                                </span>
                            </p>
                            <p v-if="item.typeid == 4">备注:{{ item.remark || '暂无' }}</p>
                            <p v-if="item.typeid == 5">放弃原因:{{ item.msg || '暂无' }}</p>
                            <p v-if="item.typeid == 5"> <span>放弃凭证:</span>
                                <span v-for="(img4, index) in imgfangqi" :key="index">
                                    <span id="photo" v-if="imgfangqi != ''">
                                        <el-image class="image" :src="img4"
                                            style="width: 80px; height:80px;vertical-align:text-top;margin-left: 5px"
                                            :preview-src-list="srcList2" @click="look6(img4)" />
                                    </span>
                                    <span v-if="imgfangqi == ''">{{ '暂无' }}</span>
                                </span>
                            </p>
                            <p v-if="item.typeid == 5">备注:{{ item.remark || '暂无' }}</p>
                            <p v-if="item.typeid == 6 || item.typeid == 8 || item.typeid == 9 || item.typeid == 13">取消原因:{{
                                item.msg || '暂无'
                            }}
                            </p>
                            <p v-if="item.typeid == 6 || item.typeid == 8 || item.typeid == 9"> <span>取消凭证:</span>
                                <span v-for="(img5, index) in imgquxiao" :key="index">
                                    <span id="photo" v-if="imgquxiao != ''">
                                        <el-image class="image" :src="img5"
                                            style="width: 80px; height:80px;vertical-align:text-top; margin-left: 5px"
                                            :preview-src-list="srcList2" @click="look7(img5)" />
                                    </span>
                                    <span v-if="imgquxiao == ''">{{ '暂无' }}</span>
                                </span>
                            </p>
                            <p v-if="item.typeid == 6 || item.typeid == 8 || item.typeid == 9">备注:{{
                                item.remark || '暂无'
                            }}
                            </p>
                            <p v-if="item.typeid == 10 || item.typeid == 11 || item.typeid == 12">退回原因:{{
                                item.msg ||
                                '暂无'
                            }}
                            </p>
                            <p v-if="item.typeid == 10 || item.typeid == 11 || item.typeid == 12"> <span>退回凭证:</span>
                                <!--   :preview-src-list="srcList2" @click="look2(imgurl1)"  -->
                                <span v-for="(img6, index) in imgtuihui" :key="index">
                                    <span id="photo" v-if="imgtuihui != ''">
                                        <el-image class="image" :src="img6"
                                            style="width: 80px; height:80px;vertical-align:text-top;margin-left: 5px"
                                            :preview-src-list="srcList2" @click="look8(img6)" />
                                    </span>
                                    <span v-if="imgtuihui == ''">{{ '暂无' }}</span>
                                </span>
                            </p>
                            <p v-if="item.typeid == 13"> <span>取消锁单凭证:</span>
                                <!--   :preview-src-list="srcList2" @click="look2(imgurl1)"  -->
                                <span v-for="(img7, index) in imgqxsuodan" :key="index">
                                    <span id="photo" v-if="imgqxsuodan != ''">
                                        <el-image class="image" :src="img7"
                                            style="width: 80px; height:80px;vertical-align:text-top;margin-left: 5px"
                                            :preview-src-list="srcList2" @click="look9(img7)" />
                                    </span>
                                    <span v-if="imgqxsuodan == ''">{{ '暂无' }}</span>
                                </span>
                            </p>
                            <p v-if="item.typeid == 10 || item.typeid == 11 || item.typeid == 12 || item.typeid == 13">备注:{{
                                item.remark ||
                                '暂无'
                            }}
                            </p>
                        </el-card>
                    </el-timeline-item>
                </el-timeline>
            </div>
        </el-dialog>
        <!-- 分配商家窗口 -->
        <el-drawer
                title="分配客资"
                :visible.sync="drawer"
                :direction="direction"
                size="60%"
                :before-close="handleClose"
                >
                <div class="drawer" style="display: flex;flex-direction: column;">
                    <div class="search_bar1">
                    <!-- <div style="display: flex;justify-content: flex-start;align-items: center;width: 100%;margin-bottom: 10px;">
                        <div class="kz_name" style="margin-right: 30px;">
                        <div style="width: 36px; margin-right: 5px;">姓名</div>
                        <el-input
                        v-model="searchIpt1"
                        placeholder="请输入"
                        size="mini"
                        style="width: 150px"
                        ></el-input>
                    </div>
                    <div class="kh_status" style="margin-right: 30px;">
                        <div style="width: 36px; margin-right: 10px">账号</div>
                        <el-input
                        v-model="searchIpt2"
                        placeholder="请输入"
                        size="mini"
                        style="width: 150px"
                        ></el-input>
                    </div>
                    <div class="mobile" style="margin-right: 30px;">
                        <div style="width: 76px; margin-right: 10px">服务种类</div>
                        <el-select v-model="selectValue1" placeholder="请选择" size="mini">
                            <el-option
                            v-for="item in options1"
                            :key="item.selectValue1"
                            :label="item.label"
                            :value="item.selectValue1" size="small">
                            </el-option>
                        </el-select>
                    </div>
                    </div> -->
                    <div style="display: flex;justify-content: flex-start;align-items: center;width: 100%;">
                        <div class="mobile" style="margin-right: 30px;">
                            <div style="width: 76px; margin-right: 6px">店铺类型</div>
                            <el-select v-model="allocationShopQuery.servetype" placeholder="请选择" size="mini" style="width: 150px;">
                                <el-option
                                v-for="item in serveType"
                                :key="item.key"
                                :label="item.label"
                                :value="item.label" size="small">
                                </el-option>
                            </el-select>
                        </div>
                        <div style="width: 76px; margin-right: 6px">店铺地址</div>
                        <el-cascader
                            size="mini"
                            :options="pcaTextArr"
                            v-model="selectedOptions"
                            @change="changeAllocationShopQuery"
                        >
                        </el-cascader>
                        <div class="search_btn" style="margin-left: 30px;">
                            <el-button type="primary" size="small" @click="getAllocationShopList">查询</el-button>
                            <el-button size="small" @click="resetAllocationShopQuery">重置</el-button>
                        </div>
                        </div>
                    </div>

                    <div class="table_part">
                    <el-table
                        v-loading="loading"
                        :data="allAllocationShop"
                        @selection-change="handleFPShopSelectionChange"
                        max-height="725"
                        :row-style="rowStyle1"
                    >
                        <el-table-column type="selection" width="35" align="center" />
                        <el-table-column label="商家编号" align="center" prop="shopid" />
                        <el-table-column label="商家名称" align="center" prop="shopname" />
                        <el-table-column label="服务种类" align="center" prop="shoptype" width="220" />
                        <el-table-column label="有效转化率" align="center" prop="rate" />
                        <el-table-column label="店铺地址" align="center" prop="shopaddress" width="300" />

                    </el-table>
                    </div>

                    <div class="confirm">
                        <el-button type="primary" size="mini" @click="kzAllocationShop">确认分配</el-button>
                        <el-button size="mini" style="width: 90px;" @click="resetAllocationShopQuery">取消</el-button>
                    </div>
                </div>
        </el-drawer>
            <!-- 审核 -->
        <el-drawer
            title="审核"
            :visible.sync="drawer1"
            :direction="direction"
            size="26%"
            :before-close="handleClose1"
            >
            <div class="drawer">
                    <div class="basic_info">
                        <div class="basic_title">
                            <div style="width: 10px;height: 10px;background: #5672FA;border-radius: 50%;margin-right: 10px;"></div>
                            <div style="font-weight: 500;font-size: 16px;color: #1F2026;">基本信息</div>
                        </div>
                        <div class="basic_body">
                            <div style="display: flex;align-items: center;margin-bottom: 16px;">
                                <div class="kz_name basic_item">
                                    <div class="basic_text">客资姓名：</div>
                                    <div class="basic_data">{{ shform.kzName }}</div>
                                </div>
                                <div class="connect basic_item">
                                    <div class="basic_text">联系方式：</div>
                                    <div class="basic_data">{{ shform.kzTel }}</div>
                                </div>
                            </div>

                            <div style="display: flex;align-items: center;margin-bottom: 16px;">
                                <div class="kz_name basic_item">
                                    <div class="basic_text">微信号：</div>
                                    <div class="basic_data">{{ shform.kzWechat }}</div>
                                </div>
                                <div class="connect basic_item">
                                    <div class="basic_text">客资来源：</div>
                                    <div class="basic_data">{{ shform.kzFrom }}</div>
                                </div>
                            </div>
                            <div style="display: flex;align-items: center;margin-bottom: 16px;">
                                <div class="kz_name basic_item">
                                    <div class="basic_text">服务种类：</div>
                                    <div class="basic_data">{{ shform.serveType }}</div>
                                </div>
                                <div class="connect basic_item">
                                    <div class="basic_text">客资预计婚期：</div>
                                    <div class="basic_data">{{ shform.kzWedding }}</div>
                                </div>
                            </div>

                            <div style="margin-bottom: 16px;">
                                <div class="kz_name basic_item">
                                    <div class="basic_text">服务城市1：</div>
                                    <div class="basic_data">{{ shform.kzWantcity }}</div>
                                </div>
                            </div>
                            <div style="margin-bottom: 16px;">
                                <div class="kz_name basic_item">
                                    <div class="basic_text">服务城市2：</div>
                                    <div class="basic_data">{{ shform.kzWantcity1 }}</div>
                                </div>
                            </div>
                          <div style="margin-bottom: 16px;">
                            <div class="kz_name basic_item">
                              <div class="basic_text">服务城市3：</div>
                              <div class="basic_data">{{ shform.kzWantcity2 }}</div>
                            </div>
                          </div>
                        </div>
                      <div class="basic_info">
                      <div class="basic_title">
                        <div style="width: 10px;height: 10px;background: #5672FA;border-radius: 50%;margin-right: 10px;"></div>
                        <div style="font-weight: 500;font-size: 16px;color: #1F2026;">审核信息</div>
                      </div>
                      <div class="sh_body">
                        <div style="display: flex;align-items: center;margin-bottom: 20px;">
                          <div class="sh_label">审核意见：</div>
                          <el-radio-group v-model="shform.type">
                            <el-radio :label="1">通过</el-radio>
                            <el-radio :label="0">驳回</el-radio>
                          </el-radio-group>

                        </div>
                        <div style="display: flex;align-items: flex-start;" v-if="sh_radio == 2">
                          <div class="sh_label"><span style="color: #F85300;">*</span>驳回原因：</div>
                          <el-input
                            type="textarea"
                            :rows="5"
                            placeholder="请输入"
                            v-model="shform.remark" style="width: 370px;">
                          </el-input>
                        </div>
                      </div>
                    </div>

                      <div class="confirm">
                        <el-button type="primary" size="mini" @click="shenhe">提交审核</el-button>
                        <el-button size="mini" style="width: 90px;">取消</el-button>
                      </div>
                    </div>


            </div>
        </el-drawer>
        <!-- 查看窗口详情 -->
        <el-drawer
      title="查看详情"
      :visible.sync="drawer2"
      :direction="direction"
      size="90%"
      :before-close="handleClose2"
    >
      <div class="drawer">

        <div class="drawer_l">
            <div class="tab_l">
                <el-tabs v-model="activeName" @tab-click="handleClick">
                    <el-tab-pane label="客资信息" name="first"></el-tab-pane>
                    <el-tab-pane label="分配商家" name="second"></el-tab-pane>
                </el-tabs>
            </div>
            <div class="basic_info" v-if="tabIndex1 == 0">
                <div class="basic_title">
                    <div style="width: 10px;height: 10px;background: #5672FA;margin-right: 10px;border-radius: 50%;"></div>
                    <div style="font-weight: 600;font-size: 16px;color: #1F2026;margin-right: 120px;">基本信息</div>
                    <div @click="handleEditStatus" style="cursor: pointer;">
                        <i class="el-icon-edit"></i>
                        <span style="font-size: 14px;color: #5672FA;">{{ editStatus == 0 ? '修改' : '保存' }}</span>
                    </div>
                </div>
                <div class="basic_info_body">
                    <div class="row_group">
                        <div class="username row_item">
                            <div>客资ID：</div>
                            <div class="confirm_text">{{ form.kzId }}</div>
                            <!-- <el-input v-model="basic_info1.basicInput1" v-if="editStatus == 1" style="width: 320px;" placeholder="请输入"></el-input> -->
                        </div>
                        <div class="fzr row_item">
                            <div>客资姓名：</div>
                            <div class="confirm_text">{{ form.kzName }}</div>

                        </div>
                    </div>
                    <div style="" class="row_group">
                        <div class="jd_type" style="width: 50%;">
                            <div>手机号：</div>
                            <div class="confirm_text" v-if="editStatus == 0">{{form.kzTel}}</div>
                            <el-input v-model="form.kzTel" v-if="editStatus == 1" style="width: 200px;" placeholder="请输入" size="mini"></el-input>
                        </div>
                        <div class="jd_type" style="width: 50%;">
                                <div style="width: 90px;">客资类型：</div>
                                <div class="confirm_text" v-if="editStatus == 0">{{form.serveType }}</div>
                                <el-select v-model="form.serveType" placeholder="请选择" v-if="editStatus == 1" size="mini">
                                    <el-option
                                    v-for="item in serveType"
                                    :key="item.key"
                                    :label="item.label"
                                    :value="item.label" size="small">
                                    </el-option>
                                </el-select>
                        </div>
                    </div>

                    <div style="" class="row_group">
                        <div class="level">
                            <div>微信号：</div>
                            <div class="confirm_text" v-if="editStatus == 0">{{form.kzWechat}}</div>

                            <el-input v-model="form.kzWechat" v-if="editStatus == 1" style="width: 200px;" placeholder="请输入" size="mini"></el-input>
                        </div>
                        <div class="rank">
                            <div>婚期：</div>
                            <div class="confirm_text" v-if="editStatus == 0">{{form.kzWedding}}</div>
                            <el-select v-model="form.kzWedding" placeholder="请选择" v-if="editStatus == 1" size="mini">
                                <el-option
                                v-for="item in kzWedding"
                                :key="item.key"
                                :label="item.label"
                                :value="item.label" size="small">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                    <div style="" class="row_group">
                      <div class="rank">
                        <div>意向城市：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{form.kzWantcity}}</div>
<!--                        <el-cascader-->
<!--                          size="mini"-->
<!--                          :options="pcaTextArr"-->
<!--                          v-model="kzWantcity" v-if="editStatus == 1"-->
<!--                          @change="handleChangeKzWantcity">-->
<!--                        </el-cascader>-->
                        <el-cascader    filterable :disabled="edit1" size="mini" ref="cascader" :options="options"
                                     style="width:204px" v-model="selectedOptions" :props="defaultParams"  v-if="editStatus == 1" @change="handleChange">
                        </el-cascader>
                      </div>
                        <div class="rank">
                            <div>所在城市：</div>
                            <div class="confirm_text" v-if="editStatus == 0">{{form.kzInWantcity}}</div>
                            <el-cascader
                                size="mini"
                                :options="pcaTextArr"
                                v-model="selectedOptions2" v-if="editStatus == 1"
                            @change="handleChangeInWantccity">
                            </el-cascader>
                        </div>
                    </div>
                    <div style="" class="row_group">
                        <div class="level">
                            <div>录入人：</div>
                            <div class="confirm_text" >{{form.puName}}</div>
                            <!-- <el-input v-model="basic_info1.basicInput4" style="width: 320px;" v-if="editStatus == 1" placeholder="请输入"></el-input> -->
                        </div>
                        <div class="level">
                            <div>客资来源：</div>
                            <div class="confirm_text">{{form.kzFrom}}</div>
                            <!-- <el-input v-model="basic_info1.basicInput4" style="width: 320px;" v-if="editStatus == 1" placeholder="请输入"></el-input> -->
                        </div>
                    </div>
                    <div style="" class="row_group">
                        <div class="level">
                            <div style="width: 80px;">入库时间：</div>
                            <div class="confirm_text"> <span>{{
                                parseTime(form.kzCreateTime, "{YY}-{MM}-{DD} {hh}:{mm}:{ss}")
                              }}</span></div>
                            <!-- <el-input v-model="basic_info1.basicInput5" style="width: 320px;" v-if="editStatus == 1" placeholder="请输入"></el-input> -->
                        </div>
                    </div>
                </div>
            </div>

            <div class="basic_info" v-if="tabIndex1 == 0">
                <div class="basic_title">
                    <div style="width: 10px;height: 10px;background: #5672FA;margin-right: 10px;border-radius: 50%;"></div>
                    <div style="font-weight: 600;font-size: 16px;color: #1F2026;margin-right: 120px;">客资状态</div>
                    <div @click="handleEditStatus1" style="cursor: pointer;">
                        <i class="el-icon-edit"></i>
                        <span style="font-size: 14px;color: #5672FA;">{{ editStatus1 == 0 ? '修改' : '保存' }}</span>
                    </div>
                </div>
                <div class="basic_info_body">
                    <div class="row_group">
                        <div class="username row_item" style="width: 100%;">
                            <div>客资状态：</div>
                            <div class="confirm_text" v-if="editStatus1 == 0" >{{ checkKzType(kzStyleChange.style) }}</div>
                            <el-radio-group v-model="kzStyleChange.style" v-if="editStatus1 == 1">
<!--                                <el-radio :label="3">有效</el-radio>-->
<!--                                <el-radio :label="6">待定</el-radio>-->
<!--                                <el-radio :label="9">进店</el-radio>-->
<!--                                <el-radio :label="1">成功订单</el-radio>-->
<!--                                <el-radio :label="2">订单待核</el-radio>-->
<!--                                <el-radio :label="4">无效</el-radio>-->
<!--                                <el-radio :label="5">死单</el-radio>-->
                              <el-radio
                                v-for="item in kzrType"
                                :key="item.value"
                                :label = "item.value">
                                {{item.label}}
                              </el-radio>
                            </el-radio-group>
                            <!-- <el-input v-model="basic_info1.basicInput1" v-if="editStatus == 1" style="width: 320px;" placeholder="请输入"></el-input> -->
                        </div>
                        <!-- <div class="fzr row_item">
                            <div>客资姓名：</div>
                            <div class="confirm_text">{{ basic_info1.selectValue0 }}</div>

                        </div> -->
                    </div>
                    <div style="" class="row_group">
                        <div class="jd_type" style="width: 100%;">
                            <div>跟进备注：</div>
                            <div class="confirm_text" v-if="editStatus1 == 0">{{kzStyleChange.remark}}</div>
                             <el-input v-model="kzStyleChange.remark" v-if="editStatus1 == 1" style="width: 200px;" placeholder="请输入" size="mini">
                               {{kzStyleChange.remark}}
                             </el-input>
                        </div>
                        <!-- <div class="jd_type" style="width: 50%;">
                                <div style="width: 90px;">客资类型：</div>
                                <div class="confirm_text" v-if="editStatus == 0">{{ basic_info1.selectValue_1 }}</div>
                                <el-select v-model="basic_info1.selectValue_1" placeholder="请选择" v-if="editStatus == 1" size="mini">
                                    <el-option
                                    v-for="item in options5"
                                    :key="item.selectValue"
                                    :label="item.label"
                                    :value="item.selectValue" size="small">
                                    </el-option>
                                </el-select>
                        </div> -->
                    </div>

                    <div style="" class="row_group">
                        <div class="level" style="width: 100%;">
                            <div>跟进状态：</div>
                             <div class="confirm_text" v-if="editStatus1 == 0">{{kzThisStyle}}</div>
                            <el-radio-group v-model="kzStyleChange.shopStyle" v-if="editStatus1 == 1">
                              <el-radio
                                v-for="item in kzzhuangtai"
                                :key="item.value"
                                :label = "item.value">
                                {{item.label}}
                              </el-radio>
                            </el-radio-group>
                        </div>
                        <!-- <div class="rank">
                            <div>婚期：</div>
                            <div class="confirm_text" v-if="editStatus == 0">{{basic_info1.rank}}</div>
                            <el-select v-model="basic_info1.selectValue2" placeholder="请选择" v-if="editStatus == 1" size="mini">
                                <el-option
                                v-for="item in options2"
                                :key="item.selectValue"
                                :label="item.label"
                                :value="item.selectValue" size="small">
                                </el-option>
                            </el-select>
                        </div> -->
                    </div>
                    <div style="" class="row_group">
                        <div class="level" disabled style="width: 100%;">
                            <div>跟进方式：</div>
                            <el-radio-group v-model="kzStyleChange.flwType">
                                <el-radio :label="3">电话</el-radio>
                                <el-radio :label="6">微信</el-radio>
                            </el-radio-group>
                        </div>
                    </div>
                    <div style="" class="row_group">
                        <div class="level" disabled style="width: 100%;display: flex;align-items: flex-start;">
                            <div>同步商家：</div>
                            <el-checkbox-group v-model="kzStyleChange.shopId"style="width: 180px;" >
<!--                                <el-checkbox label="贵阳世纪新娘婚纱" style="margin-bottom: 10px;"></el-checkbox>-->
<!--                                <el-checkbox label="六盘水诺妍婚纱摄影" style="margin-bottom: 10px;"></el-checkbox>-->
<!--                                <el-checkbox label="啦啦啦啦啦婚纱摄影" style="margin-bottom: 10px;"></el-checkbox>-->
                              <el-checkbox
                                v-for="item in thisKzShopList"
                                :label="item.shopid"
                                :key="item.shopid" style="margin-bottom: 10px;">
                                {{ item.shopname }}
                              </el-checkbox>
                            </el-checkbox-group>
                        </div>
                    </div>

                </div>
            </div>

            <div class="basic_info" v-if="tabIndex1 == 0">
                <div class="basic_title">
                    <div style="width: 10px;height: 10px;background: #5672FA;margin-right: 10px;border-radius: 50%;"></div>
                    <div style="font-weight: 600;font-size: 16px;color: #1F2026;margin-right: 120px;">凭证或图片</div>

                    <el-upload
                    class="upload-demo"
                    action="https://jsonplaceholder.typicode.com/posts/"
                    :on-change="handleChange"
                    :file-list="fileList">
                    <div @click="handleEditStatus2" style="cursor: pointer;">
                        <img src="@/assets/images/upload.png" style="width: 13px;height: 13px;margin-right: 5px;" alt="">
                        <span style="font-size: 14px;color: #5672FA;">上传图片</span>
                    </div>
                    </el-upload>
                </div>
                <div class="basic_info_body">
                    <div class="imgList">
                        <div v-for="(item,index) in imgList" :key="index">
                            <img :src="item.imgUrl" style="width: 160px;height: 160px;margin: 0 20px 20px 0;" alt="">
                        </div>
                    </div>
                </div>
            </div>

<!--         分配商家抽屉 -->
            <div class="fpsj_table" v-if="tabIndex1 == 1">
              <el-table
                v-loading="loading"
                :data="allAllocationShop"
                @selection-change="handleFPShopSelectionChange"
                max-height="725"
                :row-style="rowStyle1"
              >
                <el-table-column type="selection" width="35" align="center" />
                <el-table-column label="商家编号" align="center" prop="shopid" />
                <el-table-column label="商家名称" align="center" prop="shopname" />
                <el-table-column label="服务种类" align="center" prop="shoptype" width="220" />
                <el-table-column label="有效转化率" align="center" prop="rate" />
                <el-table-column label="店铺地址" align="center" prop="shopaddress" width="300" />

              </el-table>

              <div class="confirm">
                <el-button type="primary" size="mini" @click="kzAllocationShop">确认分配</el-button>
                <el-button size="mini" style="width: 90px;" @click="resetAllocationShopQuery">取消</el-button>
              </div>
            </div>

            <div class="demand_group">
                <div class="dm_btn fl-center" @click="choose_dm(1)" :class="dm_num == 1 ? 'active_btn' : ''">
                    <div>没挖</div>
                    <img src="@/assets/images/foot_t.png" style="width: 16px;height: 16px;position: absolute;right: 0;bottom: 0;" alt="" v-if="dm_num == 1">
                </div>
                <div class="dm_btn fl-center" @click="choose_dm(2)" :class="dm_num == 2 ? 'active_btn' : ''">
                    <div>无需求</div>
                    <img src="@/assets/images/foot_t.png" style="width: 16px;height: 16px;position: absolute;right: 0;bottom: 0;" alt="" v-if="dm_num == 2">
                </div>
                <div class="dm_btn fl-center" @click="choose_dm(3)" :class="dm_num == 3 ? 'active_btn' : ''">
                    <div>有需求</div>
                    <img src="@/assets/images/foot_t.png" style="width: 16px;height: 16px;position: absolute;right: 0;bottom: 0;" alt="" v-if="dm_num == 3">
                </div>
            </div>
        </div>

        <div class="drawer_r">
            <div class="tab_r">
                <el-tabs v-model="activeName1" @tab-click="handleClick1">
                    <el-tab-pane label="平台备注" name="first"></el-tab-pane>
                    <el-tab-pane label="商家备注" name="second"></el-tab-pane>
                </el-tabs>
            </div>
<!--平台备注-->
            <div class="tip_step" v-if="tabIndex2 == 0">
                <el-timeline>
                    <el-timeline-item v-for="item in ptKzChangLog" :timestamp="parseTime(item.addtime,'{YY}-{MM}-{DD} {hh}:{mm}:{ss}')" placement="top">
                    <el-card style="position: relative;">
                        <div style="margin-bottom: 10px;">
                            <span class="tl_title">客服：</span>
                            <span class="tl_text" style="margin-right: 20px;">{{item.puName}}</span>
                            <div class="sx fl-center">
                                <div style="color: #fff;font-size: 12px;">{{item.styleinfo}}</div>
                            </div>
                        </div>
                        <div style="margin-bottom: 10px;" v-if="item.shopname != null">
                            <span class="tl_title">分配商家：</span>
                            <span class="tl_text">{{item.shopname}}</span>
                        </div>
                        <div class="yxgj">
                          {{item.style}}
                        </div>
                    </el-card>
                    </el-timeline-item>
                </el-timeline>
            </div>

<!--          商家备注 -->
            <div class="tip_step" v-if="tabIndex2 == 1">
<!--                <el-timeline>-->
<!--                    <el-timeline-item timestamp="贵阳世纪新娘婚纱" placement="top">-->
<!--                    <el-card style="background: #F5F7FA;margin-bottom: 10px;">-->
<!--                        <h4>2024-02-15  10:23:49</h4>-->
<!--                        <p>商家：<span>黄蕾(15000000000)</span></p>-->
<!--                        <p>状态：<span>持续跟进</span></p>-->
<!--                    </el-card>-->
<!--                    <el-card style="background: #F5F7FA;margin-bottom: 10px;">-->
<!--                        <h4>2024-02-15  10:23:49</h4>-->
<!--                        <p>商家：<span>黄蕾(15000000000)</span></p>-->
<!--                        <p>状态：<span>持续跟进</span></p>-->
<!--                    </el-card>-->
<!--                    <el-card style="background: #F5F7FA;">-->
<!--                        <h4>2024-02-15  10:23:49</h4>-->
<!--                        <p>商家：<span>黄蕾(15000000000)</span></p>-->
<!--                        <p>状态：<span>持续跟进</span></p>-->
<!--                    </el-card>-->
<!--                    </el-timeline-item>-->
<!--                    <el-timeline-item timestamp="六盘水诺妍婚纱摄影" placement="top">-->
<!--                        <el-card style="background: #F5F7FA;margin-bottom: 10px;">-->
<!--                        <h4>2024-02-15  10:23:49</h4>-->
<!--                        <p>商家：<span>黄蕾(15000000000)</span></p>-->
<!--                        <p>状态：<span>持续跟进</span></p>-->
<!--                    </el-card>-->
<!--                    <el-card style="background: #F5F7FA;margin-bottom: 10px;">-->
<!--                        <h4>2024-02-15  10:23:49</h4>-->
<!--                        <p>商家：<span>黄蕾(15000000000)</span></p>-->
<!--                        <p>状态：<span>持续跟进</span></p>-->
<!--                    </el-card>-->
<!--                    <el-card style="background: #F5F7FA;">-->
<!--                        <h4>2024-02-15  10:23:49</h4>-->
<!--                        <p>商家：<span>黄蕾(15000000000)</span></p>-->
<!--                        <p>状态：<span>持续跟进</span></p>-->
<!--                    </el-card>-->
<!--                    </el-timeline-item>-->
<!--                    <el-timeline-item timestamp="贵阳世纪新娘婚纱" placement="top">-->
<!--                        <el-card style="background: #F5F7FA;margin-bottom: 10px;">-->
<!--                        <h4>2024-02-15  10:23:49</h4>-->
<!--                        <p>商家：<span>黄蕾(15000000000)</span></p>-->
<!--                        <p>状态：<span>持续跟进</span></p>-->
<!--                    </el-card>-->
<!--                    <el-card style="background: #F5F7FA;margin-bottom: 10px;">-->
<!--                        <h4>2024-02-15  10:23:49</h4>-->
<!--                        <p>商家：<span>黄蕾(15000000000)</span></p>-->
<!--                        <p>状态：<span>持续跟进</span></p>-->
<!--                    </el-card>-->
<!--                    <el-card style="background: #F5F7FA;">-->
<!--                        <h4>2024-02-15  10:23:49</h4>-->
<!--                        <p>商家：<span>黄蕾(15000000000)</span></p>-->
<!--                        <p>状态：<span>持续跟进</span></p>-->
<!--                    </el-card>-->
<!--                    </el-timeline-item>-->
<!--                </el-timeline>-->
              <el-timeline>
                <el-timeline-item v-for="item  in shopKzLogMap"  :timestamp="item.shopname" placement="top">
                    <el-card style="background: #F5F7FA;">
                      <h4>{{ parseTime(item.changetime, '{YY}-{MM}-{DD} {hh}:{mm}:{ss}') }}</h4>
                      <p>商家：<span>{{item.shopname}}</span></p>
                      <p>状态：<span>{{item.typename}}</span></p>
                    </el-card>
                </el-timeline-item>
              </el-timeline>
            </div>
        </div>
      </div>
        </el-drawer>

        <el-dialog :visible.sync="open7" :title="title7" width="670px" append-to-body >
            <div style="display: flex;flex-direction: column;height: 420px;">
                <div class="dBody">
                    <div class="dRow">
                        <div class="dItem">
                            <div>客资姓名：</div>
                            <div>江江姜</div>
                        </div>
                    </div>
                    <div class="dRow">
                        <div class="dItem">
                            <div>手机号：</div>
                            <el-input v-model="basic_info3.basicInput1" style="width: 200px;" placeholder="请输入" size="mini"></el-input>
                        </div>
                        <div class="dItem">
                            <div>客资类型：</div>
                            <el-select v-model="basic_info3.selectValue" placeholder="请选择" size="mini">
                                <el-option
                                v-for="item in options6"
                                :key="item.selectValue"
                                :label="item.label"
                                :value="item.selectValue" size="small">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                    <div class="dRow">
                        <div class="dItem">
                            <div>微信号：</div>
                            <el-input v-model="basic_info3.basicInput2" style="width: 200px;" placeholder="请输入" size="mini"></el-input>
                        </div>
                        <div class="dItem">
                            <div>婚期：</div>
                            <el-select v-model="basic_info3.selectValue1" placeholder="请选择" size="mini">
                                <el-option
                                v-for="item in options7"
                                :key="item.selectValue"
                                :label="item.label"
                                :value="item.selectValue" size="small">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                    <div class="dRow">
                        <div class="dItem">
                            <div>意向城市：</div>
                            <el-cascader
                                    size="mini"
                                    :options="pcaTextArr"
                                    v-model="selectedOptions2">
                                </el-cascader>
                        </div>
                        <div class="dItem">
                            <div>所在城市：</div>
                            <el-cascader
                                    size="mini"
                                    :options="pcaTextArr"
                                    v-model="selectedOptions3">
                                </el-cascader>
                        </div>
                    </div>
                    <div class="dRow">
                        <div class="dItem">
                            <div>客资来源：</div>
                            <el-select v-model="basic_info3.selectValue2" placeholder="请选择" size="mini">
                                <el-option
                                v-for="item in options8"
                                :key="item.selectValue"
                                :label="item.label"
                                :value="item.selectValue" size="small">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                    <div class="dRow">
                        <div class="dItem">
                            <div>备注：</div>
                            <el-input v-model="basic_info3.basicInput3" style="width: 200px;" placeholder="请输入" size="mini"></el-input>
                        </div>
                    </div>
                    <div class="dRow">
                        <div class="dItem">
                            <div>上传图片：</div>
                            <el-upload
                            class="upload-demo"
                            action="https://jsonplaceholder.typicode.com/posts/"
                            :on-preview="handlePreview2"
                            :on-remove="handleRemove2"
                            :file-list="fileList"
                            list-type="picture">
                            <img src="@/assets/images/upload_img.png" style="width: 80px;height: 80px;" alt="">
                            </el-upload>
                        </div>
                    </div>
                </div>
                <div class="confirm1" style="display: flex;justify-content: flex-end;width: 100%;margin-top: 20px;">
                    <el-button size="mini" style="width: 90px;">取消</el-button>
                    <el-button type="primary" size="mini" style="width: 90px;">提交</el-button>
                </div>
            </div>
        </el-dialog>
    </div>
</template>

<script>
import {
  selectAllkzs,
  insertZkwlResourcePC,
  findOneKz,
  change,
  selectcountKZ,
  selectAllpaidan,
  ExcelstAllkzs,
  importTemplate,
  findAllShopa, kzfenpeishangjia, findOne, getKzShopLog, getPtKzChangeLog, changeKzStyle, getCzUserList
} from "@/api/kuser/allkz.js";
import { selectjilu } from "@/api/business/userlist.js"
import { youxiaoshenhe } from "@/api/kuser/allkz.js";
import { checkPermi, checkRole, hasRole } from "@/utils/permission.js";
import { getToken } from '@/utils/auth';
import allData from '@/api/kuser/level-data.js';
import {
  provinceAndCityData,
  pcTextArr,
  regionData,
  pcaTextArr,
  codeToText,
} from "element-china-area-data";
import {parseTime} from "../../utils/ruoyi";
import form from "element-ui/packages/form";

export default {
    name:'Allkz',
  computed: {
    form() {
      return form
    }
  },
    data() {
        return {
            lock: false,
            lock1: false,
            isloading: false,
            imgsuodan: '',
            imgchengjiao: '',
            imgzhuanrang: '',
            imgfangqi: '',
            imgquxiao: '',
            imgtuihui: '',
            imgqxsuodan: '',
            edit1: false,
            imgchengjiao: '',
            srcList2: [],
            // 查看跟进记录
            jiLuList: [],
          thisKzShopList:[],
          kzThisStyle:"",

          //客资状态修改
          kzStyleChange:{
              kzId:"",
              shopId:[],
              style:"1",
              shopStyle:"1",
              flwType:"",//跟进方式
              remark:"",
          },


            reverse: true,
            srcList_L: [],
            startDatePicker: this.beginDate(),
            endDatePicker: this.processDate(),
            srcList: [],
            srcList_s: [],
            edit: true,
            quanxian: false,
            edit: true,
            fileList: [],
            imgUrl: {
                headers: {
                    Authorization: "Bearer " + getToken(),
                },
                url: process.env.VUE_APP_BASE_API + "/upload/fileUpload"
            },
            options: allData,
            defaultParams: {
                value: "name", //设置默认值value
                label: "name", //设置显示的是什么
                children: "children" //设置子元素数组是啥
            },
            selectedOptions: [],
            selectedOptions1: [],
            selectedOptions2: [],
            // 预计婚期
            kzWedding: [{
                key: '1',
                label: '三个月内'
            }, {
                key: '2',
                label: '半年内'
            }, {
                key: '3',
                label: '一年内'
            }, {
                key: '4',
                label: '一年以上/婚期未定'
            }, {
                key: '5',
                label: '无'
            }],
            xinxi: {
                dingdan: '',
                duodan: '',
                kezituihui: '',
                quanbukz: '',
                tuidan: ''
            },
            paidanList: [],
            detailsList: [],
            open1: false,
            // 遮罩层
            loading: true,
            // 选中数组
            ids: [],
            // 非单个禁用
            single: true,
            // 非多个禁用
            multiple: true,
            // 显示搜索条件
            showSearch: true,
            // 总条数
            total: 0,
            // 表格数据
            resourceList: [],
            // 弹出层标题
            title: "",
            title1: "",
            title3: "",
            title4: "",
            title5: "",
            title6: "",
            title7: "",
            // 是否显示弹出层
            open: false,
            open2: false,
            open3: false,
            open4: false,
            open6: false,
            open7: false,
            serveType: [{
                key: '1',
                label: '婚纱礼服'
            }, {
                key: '2',
                label: '婚礼策划'
            }, {
                key: '3',
                label: '婚宴酒店'
            }, {
                key: '4',
                label: '婚纱摄影'
            }],
            kztype: [{
                value: '3',
                label: '有效'
            }, {
                value: '2',
                label: '无效'
            }, {
                value: '1',
                label: '待审核'
            }],
            servetype: [{
                key: '1',
                label: '婚纱礼服'
            }, {
                key: '2',
                label: '婚礼策划'
            }, {
                key: '3',
                label: '婚宴酒店'
            }, {
                key: '4',
                label: '婚纱摄影'
            }],
            kzfrom: [{
                key: '1',
                label: '微信留资'
            }, {
                key: '2',
                label: '手动留资'
            }, {
                key: '3',
                label: '分享留资'
            }, {
                key: '4',
                label: '后台录入'
            }, {
                key: '5',
                label: '异业录入'
            }],
            remark: [{
                key: 1,
                label: '没挖'
            }, {
                key: 2,
                label: '无需求'
            },
              {
                key: 3,
                label: '有需求'
              },],
            td_type: [{
                key: 1,
                label: '其他类型'
            }, {
                key: 2,
                label: '客户一开始明确表示无需求 不需要'
            },
              {
                key: 3,
                label: '电联多次无接听,接通后无需求'
              },
              {
                key: 4,
                label:'进群秒退群 无联系电话'
              },
              {
                key: 5,
                label:'添加微信多次 未通过'
              },
              {
                key: 6,
                label:'进群不说话 连续三天激活无回应'
              },
              {
                key: 7,
                label:'不是给本人咨询,咨询业务不符合'
              }
            ],
            bd_type: [{
                key: 1,
                label: '报单类型1'
            }, {
                key: 2,
                label: '报单类型2'
            },],
            // td_type: [{
            //     key: 1,
            //     label: '退单类型1'
            // }, {
            //     key: 2,
            //     label: '退单类型2'
            // },],
            czy: [],
            o_search: '',
          kzrType:[
            {value:"1",label: '正在审核'},
            {value:"2",label: '无效客资'},
            {value:"3",label: '跟进中'},
            {value:"4",label: '订单成交'},
            {value:"5",label: '客资撤回'},
            {value:"6",label: '取消订单'},
            {value:"0",label: '待审核'},
            {value:"7",label: '审核通过'},
          ],
            genjin: [{
                value: '1',
                label: '未分配'
            }, {
                value: '2',
                label: '已分配'
            }],
            kzzhuangtai: [{
                value: '0',
                label: '待领取'
            }, {
                value: '1',
                label: '已领取'
            }, {
                value: '2',
                label: '活动锁单'
            }, {
                value: '3',
                label: '订单成交'
            }, {
                value: '4',
                label: '转让客资'
            }, {
                value: '5',
                label: '放弃客资'
            }, {
                value: '6',
                label: '取消订单申请'
            }, {
                value: '8',
                label: '取消订单成功'
            }, {
                value: '9',
                label: '取消订单失败'
            }, {
                value: '10',
                label: '客资退回申请'
            }, {
                value: '11',
                label: '客资退回成功'
            }, {
                value: '12',
                label: '客资退回失败'
            }, {
                value: '13',
                label: '取消活动锁单'
            },],
            fenpei: [{ value: '1', label: '是' }, { value: '2', label: '否' }],
            endTimes: '',
            // 查询参数
            queryParams: {
                pageNum: 1,
                pageSize: 10,
                td_type: '',
                kzname: '',
                kzwechat: '',
                kzid: '',
                kztel: '',
                servetype: '',
                kzfrom: '',
                nickname: '',
                kzwedding: '',
                ynname: '',
                ynpic: '',
                ynyouxiao: '',
                startTime: '',
                endTime: '',
                sheng: '',
                shi: '',
                shopnum: '',
                ynfenpei: '',
                wuxiao: '',
                shopfenpei: '',
                ynshops: '',
                paidanname: '',
                pdstarttime: '',
                pdendtime: '',
                fid: '',
                userid: '',
                kzsw: '',
            },
            // 表单参数
            form: {
                kzVoucherPic: '',
                kzWantcity:'',
                kzWantcity1: '',
                kzWantcity2: '',
              kzInWantcity:'',
                kztel: '',
                kzwechat: '',
                kzTel: '',
                puName:'',
            },

            kzInWantCity:'',
            shform: {
                kzId: '',
                serveType: '',
                kzWedding: '',
                kzWantcity: '',
                kzWantcity1: '',
                kzWantcity2: '',
                kzVoucherPic: '',
                kzTel: '',
                kzWechat: '',
                kzFrom: '',
                kzName: '',
                type: 1,
                remark: "",
                kzRemark: '',
            },
          kzWantcity:"",
            fenpeiList: [],
            // 表单校验
            rules: {
                // kzTel: [{ message: "联系方式不能为空", trigger: "blur" },
                // {
                //     pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
                //     message: "请输入正确的手机号码",
                //     trigger: "blur"
                // }],
                // kzWechat: [{ message: "微信号不能为空", trigger: "blur" }],
                // kzName: [{ required: true, message: "客资姓名不能为空", trigger: "blur" }],
                serveType: [{ required: true, message: "服务种类不能为空", trigger: "blur" }],
                kzWedding: [{ required: true, message: "预计婚期不能为空", trigger: "blur" }],
                kzWantcity: [{ required: true, message: "服务城市不能为空", trigger: "blur" }],
                remark: [{ required: true, message: "驳回原因不能为空", trigger: "change" }]
                // kzVoucherPic: [{ required: true, message: "聊天及截图不能为空", trigger: "blur" }],
            },
            // 用户导入参数
            upload: {
                // 是否显示弹出层（用户导入）
                open: false,
                // 弹出层标题（用户导入）
                title: "",
                // 是否禁用上传
                isUploading: false,
                // 是否更新已经存在的用户数据
                updateSupport: 0,
                // 设置上传的请求头部
                headers: { Authorization: "Bearer " + getToken() },
                // 上传的地址
                url: process.env.VUE_APP_BASE_API + "/allkz/importData"
            },

            showOtherFilter: false,
            drawer: false,
            searchIpt1:'',
            searchIpt2:'',
            searchIpt3:'',
            timePicker1: '',
            loading: true,
            detailList2: [
                {
                    ID: "00001",
                    name: "黄格格",
                    fw_type: '摄影-婚纱摄影、全家福、写真...',
                    trans_rate: '23.14%',
                    address: '海南省三亚市天涯区红树湾A8-207号房'
                },
                {
                    ID: "00001",
                    name: "黄格格",
                    fw_type: '摄影-婚纱摄影',
                    trans_rate: '23.14%',
                    address: '海南省三亚市天涯区红树湾A8-207号房'
                },
                {
                    ID: "00001",
                    name: "黄格格",
                    fw_type: '摄影-婚纱摄影',
                    trans_rate: '23.14%',
                    address: '海南省三亚市天涯区红树湾A8-207号房'
                },
                {
                    ID: "00001",
                    name: "黄格格",
                    fw_type: '摄影-写真',
                    trans_rate: '23.14%',
                    address: '海南省三亚市天涯区红树湾A8-207号房'
                },
                {
                    ID: "00001",
                    name: "黄格格",
                    fw_type: '摄影-全家福',
                    trans_rate: '23.14%',
                    address: '海南省三亚市天涯区红树湾A8-207号房'
                },
                {
                    ID: "00001",
                    name: "黄格格",
                    fw_type: '摄影-写真',
                    trans_rate: '23.14%',
                    address: '海南省三亚市天涯区红树湾A8-207号房'
                },
            ],
            options2: [{
                selectValue: '选项1',
                label: '摄影-婚纱摄影、全家福、写真...'
                },
                {
                    selectValue: '选项2',
                    label: '摄影-婚纱摄影'
                },
                {
                    selectValue: '选项3',
                    label: '摄影-儿童摄影'
                },
                {
                    selectValue: '选项4',
                    label: '摄影-写真'
                },
                {
                    selectValue: '选项5',
                    label: '摄影-全家福'
                },
            ],
            selectValue2: '',
            pcaTextArr,
            selectedOptions: [],
            selectedOptions1: [],
            selectedOptions2: [],
            selectedOptions3: [],
            basic_info: {
                username: '王优优',
                phone: '15600000000',
                wx: '15600000000',
                kz_source: '手动录入',
                service_type: '婚纱摄影',
                yqhq: '三个月内',
                ser_city1: '海南省-三亚市-全部',
                ser_city2: '海南省-三亚市-全部',
            },
            drawer1: false,
            drawer2: false,
            sh_radio: 1,
            textarea1: '',
            direction: 'rtl',
            restaurants: [],
            otherState: '',
            timeout:  null,
            editStatus: 0,
            editStatus1: 0,
            activeName: 'first',
            activeName1: 'first',
            activeName2: 'second',
            options: [{
            selectValue: '选项1',
            label: '支出'
            }, {
            selectValue: '选项2',
            label: '收入'
            }],
            options1: [{
            selectValue: '选项1',
            label: '张三'
            }, {
            selectValue: '选项2',
            label: '李四'
            }],
            options5: [{
            selectValue: '选项1',
            label: '摄影-婚纱摄影'
            }, {
            selectValue: '选项2',
            label: '摄影-全家福'
            }],
            options2: [{
            selectValue: '选项1',
            label: '婚期1'
            }, {
            selectValue: '选项2',
            label: '婚期2'
            },
            {
            selectValue: '选项3',
            label: '婚期3'
            },],
            options3: [{
            selectValue: '选项1',
            label: '正常'
            }, {
            selectValue: '选项2',
            label: '禁用'
            }],
            options6: [
                {
                selectValue: '选项1',
                label: '摄影-婚纱摄影'
                },
                {
                selectValue: '选项2',
                label: '摄影-全家福'
                },
                {
                selectValue: '选项3',
                label: '摄影-全家福2'
                },
            ],
            options7: [
                {
                selectValue: '选项1',
                label: '一个月内'
                },
                {
                selectValue: '选项2',
                label: '两个月内'
                },
                {
                selectValue: '选项3',
                label: '三个月内'
                },
            ],
            options8: [
                {
                selectValue: '选项1',
                label: '抖音'
                },
                {
                selectValue: '选项2',
                label: '快手'
                },
            ],
            basic_info1: {
                basicInput1: '佐卡伊婚纱摄影',
                basicInput2: '文焅泓',
                basicInput9: 'a415647415236',
                basicInput3: '1500000000',
                basicInput4: '抖音',
                basicInput5: '湖南省常德市武陵区武陵区步行街巴黎婚纱摄影',
                basicInput6: '1',
                basicInput7: '￥9999.00',
                basicInput8: '￥999.00',
                selectValue0: '张三',
                selectValue: '摄影-婚纱摄影',
                selectValue_1: '摄影-全家福',
                selectValue1: '333',
                selectValue2: '选项1',
                selectValue3: '选项1',
                rank: '诚信商户',
                JJText: '吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧吧啦吧啦吧啦吧啦',
            },
            basic_info2: {
                basicInput1: '有效客资',
                basicInput2: '文焅泓',
                basicInput9: 'a415647415236',
                basicInput3: '江巴拉巴拉巴拉啦啦啦啦啦啦啦',
                basicInput4: '抖音',
                basicInput5: '湖南省常德市武陵区武陵区步行街巴黎婚纱摄影',
                basicInput6: '1',
                basicInput7: '￥9999.00',
                basicInput8: '￥999.00',
                selectValue0: '张三',
                selectValue: '摄影-婚纱摄影',
                selectValue_1: '摄影-全家福',
                selectValue1: '333',
                selectValue2: '选项1',
                selectValue3: '选项1',
                rank: '诚信商户',
                JJText: '吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧吧啦吧啦吧啦吧啦',
            },
            basic_info3: {
                basicInput1: '15600000000',
                basicInput2: '15600000000',
                basicInput9: 'a415647415236',
                basicInput3: '江巴拉巴拉巴拉啦啦啦啦啦啦啦',
                basicInput4: '抖音',
                basicInput5: '湖南省常德市武陵区武陵区步行街巴黎婚纱摄影',
                basicInput6: '1',
                basicInput7: '￥9999.00',
                basicInput8: '￥999.00',
                selectValue0: '张三',
                selectValue: '摄影-婚纱摄影',
                selectValue_1: '摄影-全家福',
                selectValue1: '三个月内',
                selectValue2: '选项1',
                selectValue3: '选项1',
                rank: '诚信商户',
                JJText: '吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧吧啦吧啦吧啦吧啦',
            },
            tabIndex1: 0,
            tabIndex2: 0,
            tabIndex3: 0,
            kzSRadio: 3,
            kzSRadio2: 3,
            kzSRadio3: 3,
            checkList: ['贵阳世纪新娘婚纱'],
            imgList: [
                {
                    imgUrl: '../assets/logo/logo.png'
                },
            ],
            tip_step: [
                {
                    time: '2024-02-24   11:54:26',
                    status: 0,  // 0 有效/有效跟进
                    customer: '黄蕾(麦麦)',
                    conn_way: '私信',
                    fp_shop: '六盘水婚纱摄影',
                    yx_city: '贵州-贵阳',
                },
                {
                    time: '2024-02-24   11:54:26',
                    status: 0,  // 0 有效/有效跟进
                    customer: '黄蕾(麦麦)',
                    conn_way: '私信',
                    fp_shop: '六盘水婚纱摄影',
                    yx_city: '贵州-贵阳',
                },
                {
                    time: '2024-02-24   11:54:26',
                    status: 0,  // 0 有效/有效跟进
                    customer: '黄蕾(麦麦)',
                    conn_way: '私信',
                    fp_shop: '六盘水婚纱摄影',
                    yx_city: '贵州-贵阳',
                },
                {
                    time: '2024-02-24   11:54:26',
                    status: 0,  // 0 有效/有效跟进
                    customer: '黄蕾(麦麦)',
                    conn_way: '私信',
                    fp_shop: '六盘水婚纱摄影',
                    yx_city: '贵州-贵阳',
                },
                {
                    time: '2024-02-24   11:54:26',
                    status: 0,  // 0 有效/有效跟进
                    customer: '黄蕾(麦麦)',
                    conn_way: '私信',
                    fp_shop: '六盘水婚纱摄影',
                    yx_city: '贵州-贵阳',
                    imgList: [
                        {
                            imgUrl: '../assets/logo/logo.png'
                        },
                        {
                            imgUrl: '../assets/logo/logo.png'
                        },
                    ],
                },
            ],

          //分配商家查询参数
          allocationShopQuery: {
            servetype: "",
            shopaddress: "",
            kzid: "",
          },
            //可以分配的商家集合
            allAllocationShop: [
            ],
          //kz商家备注列表
          shopKzLogMap:[],

          //平台备注列表
          ptKzChangLog:[],

            dm_num: null,
            fileList: []
        };
    },
    created() {
        this.options = allData;
        this.getList();
        this.xinxiList();
        this.paidan();
        this.quanxian = checkRole(['shangjia']);
        // console.log(this.quanxian);
    },
    mounted() {
        this.restaurants = this.loadAll();
    },
    methods: {
      parseTime,
        close() {
            this.reset();
        },
        loadAll() {
            return [
                { "value": "张三", "address": "" },
                { "value": "李四", "address": "" },
                { "value": "王五", "address": "" },
            ]
        },
        querySearchAsync(queryString, cb) {
        var restaurants = this.restaurants;
        var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;

        clearTimeout(this.timeout);
        this.timeout = setTimeout(() => {
          cb(results);
        }, 3000 * Math.random());
      },
      createStateFilter(queryString) {
        return (state) => {
          return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
        };
      },
      handleSelect(item) {
        console.log(item);
      },
        /** 查询客资列表 */
        async getList() {
            this.loading = true;
            let res = await selectAllkzs(this.queryParams);
            this.resourceList = res.rows;
            res.rows.forEach(item => {
                this.paidanName = item.allShopnamePuname;
                item.kzVoucherPic = item.kzVoucherPic.split(',');
                // let str = item.wantcity;
                // if (str.indexOf('-') == 3) {
                //     let strs = str.split('-');
                //     strs = strs.join('');
                //     let reg = /.+?(省|市|自治区|自治州|县|区)/g;
                //     let bb = strs.match(reg);
                //     if (bb[1] != undefined && bb[2] != undefined) {
                //         item.wantcity = bb[0] + bb[1] + bb[2];
                //     } else if (bb[1] != undefined && bb[2] == undefined) {
                //         item.wantcity = bb[0] + bb[1];
                //     } else if (bb[1] == undefined && bb[2] == undefined) {
                //         item.wantcity = bb[0];
                //     }
                // }

                // console.log(this.quanxian);
                // item.wantcity = bb[0] + bb[1] + bb[2];
                // console.log(item.wantcity);
                // if (this.quanxian == true) {
                //     let str = item.wantcity;
                //     let reg = /.+?(省|市|自治区|自治州|县|区)/g;
                //     let bb = str.match(reg);
                //     if (bb[1] != undefined && bb[2] != undefined) {
                //         item.wantcity = bb[0] + bb[1] + bb[2];
                //     } else if (bb[1] != undefined && bb[2] == undefined) {
                //         item.wantcity = bb[0] + bb[1];
                //     } else if (bb[1] == undefined && bb[2] == undefined) {
                //         item.wantcity = bb[0];
                //     }
                //     item.wantcity = bb[0] + bb[1] + bb[2]
                // }
            })
            this.total = res.total;
            this.loading = false;
        },
        async xinxiList() {
            let response = await selectcountKZ();
            this.xinxi = response;
            this.xinxi.quanbukz = response.quanbukz
            this.xinxi.dingdan = response.dingdan
            this.xinxi.duodan = response.duodan
            this.xinxi.kezituihui = response.kezituihui
            this.xinxi.tuidan = response.tuidan
        },
        // 派单员列表
        async paidan() {
            let response = await selectAllpaidan();
            console.log(response);
            this.paidanList = response.data;
            console.log(this.paidanList);
        },

        //操作员
      async czUser() {
        let response = await getCzUserList();
        console.log("操作员"+response);
        this.czy = response.data;
      },
        // 取消按钮
        cancel() {
            this.open = false;
            this.reset();
        },
        // 表单重置
        reset() {
            this.form = {
                kzName: null,
                serveType: null,
                kzTel: null,
                kzWechat: null,
                kzFrom: null,
                kzWantcity: null,
                kzWantcity1: null,
                kzWantcity2: null,
                kzWedding: null,
                kzVoucherPic: null,
            };
            this.shform = {
                kzId: '',
                serveType: '',
                kzWedding: '',
                kzWantcity: '',
                kzWantcity1: '',
                kzWantcity2: '',
                kzVoucherPic: '',
                kzTel: '',
                kzWechat: '',
                kzFrom: '',
                kzName: '',
                type: 1,
                remark: "",
                kzRemark: '',
            },
                this.selectedOptions = [];
            this.selectedOptions1 = [];
            this.selectedOptions2 = [];
            this.resetForm("form");
            this.fileList = [];
        },
        /** 搜索按钮操作 */
        handleQuery() {
            if (this.queryParams.startTime == '' && this.endTimes == "") {
                selectAllkzs(this.queryParams).then(response => {
                    this.resourceList = response.rows;
                    this.resourceList.forEach(item => {
                        item.kzVoucherPic = item.kzVoucherPic.split(',');
                    })
                    this.total = response.total;
                })
            } else if (this.queryParams.startTime == "" && this.endTimes != '') {
                this.$modal.msgError("请输入开始时间");
            } else if (this.queryParams.startTime != '' && this.endTimes == '') {
                this.$modal.msgError("请输入结束时间");
            } else if (this.queryParams.startTime != '' && this.endTimes != '' && this.queryParams.startTime > this.endTimes) {
                this.$modal.msgError("结束时间必须大于开始时间！");
            } else if (this.queryParams.startTime != '' && this.endTimes != '' && this.queryParams.startTime < this.endTimes) {
                this.queryParams.endTime = this.endTimes + 24 * 60 * 60 * 1000 - 1;
                selectAllkzs(this.queryParams).then(response => {
                    this.queryParams.endTime = this.queryParams.endTime - 24 * 60 * 60 * 1000 - 1;
                    this.resourceList = response.rows;
                    this.resourceList.forEach(item => {
                        item.kzVoucherPic = item.kzVoucherPic.split(',');
                    })
                    this.total = response.total;
                })
            } else if (this.queryParams.startTime == this.endTimes) {
                this.queryParams.endTime = this.endTimes + 24 * 60 * 60 * 1000 - 1;
                selectAllkzs(this.queryParams).then(response => {
                    this.queryParams.endTime = this.queryParams.endTime - 24 * 60 * 60 * 1000 - 1;
                    this.resourceList = response.rows;
                    this.resourceList.forEach(item => {
                        item.kzVoucherPic = item.kzVoucherPic.split(',');
                    })
                    this.total = response.total;
                })
            }
        },
        /** 重置按钮操作 */
        resetQuery() {
            this.queryParams = {
                pageNum: 1,
                pageSize: 10,
                kzname: '',
                kzwechat: '',
                kzid: '',
                kztel: '',
                servetype: '',
                kzfrom: '',
                nickname: '',
                kzwedding: '',
                ynname: '',
                ynpic: '',
                ynyouxiao: '',
                startTime: '',
                endTime: '',
                sheng: '',
                shi: '',
                shopnum: '',
                ynfenpei: '',
                wuxiao: '',
                shopfenpei: '',
                ynshops: '',
                paidanname: '',
                fid: ''
            };
            this.endTimes = '';
            this.getList();
        },
        // 多选框选中数据
        handleSelectionChange(selection) {
            this.ids = selection.map(item => item.kzid);
            this.single = selection.length !== 1
            this.multiple = !selection.length
        },
        /** 新增按钮操作 */
        handleAdd() {
            this.reset();
            this.open = true;
            this.title = "添加客资";
            this.selectedOptions = allData;
        },
        /** 修改按钮操作 */
        handleUpdate(row) {
            if (this.quanxian == true) {
                this.edit1 = true;
            }
            this.reset();
            const kzId = row.kzId
            findOneKz({ kzid: row.kzid }).then(response => {
                this.form = response.data.user;
                if (this.form.kzTel == '暂无') {
                    this.form.kzTel = '';
                }
                if (this.form.kzWechat == '暂无') {
                    this.form.kzWechat = '';
                }
                this.open = true;
                this.title = "修改客资";
                if (this.quanxian == true) {
                    let strr = row.wantcity;
                    let reg = /.+?(省|市|自治区|自治州|县|区)/g;
                    let cc = strr.match(reg);
                    this.selectedOptions = [cc[0], cc[1], cc[2]];
                }
                if (this.quanxian == false) {
                    if (response.data.user.kzWantcity != '') {
                        let city = response.data.user.kzWantcity;
                        // console.log(city);
                        // console.log(city.indexOf('-'));
                        if (city.indexOf('-') == 3) {
                            city = city.split('-').join('');
                            // console.log(city);
                        }
                        let reg = /.+?(省|市|自治区|自治州|县|区)/g;
                        let citys = city.match(reg);
                        // console.log(citys,'1111111');
                        if (citys[0] != undefined && citys[1] != undefined && citys[2] != undefined) {
                            this.selectedOptions = [citys[0], citys[1], citys[2]];
                        } else if (citys[0] != undefined && citys[1] != undefined && citys[2] == undefined) {
                            this.selectedOptions = [citys[0], citys[1], '全部'];
                        } else if (citys[0] != undefined && citys[1] == undefined && citys[2] == undefined) {
                            this.selectedOptions = [citys[0], '全部', '全部'];
                        }
                    } else {
                        this.selectedOptions = [];
                    }
                    if (response.data.user.kzWantcity1 != '') {
                        let reg = /.+?(省|市|自治区|自治州|县|区)/g;
                        let city1 = response.data.user.kzWantcity1;
                        let citys1 = city1.match(reg);
                        if (citys1[0] != undefined && citys1[1] != undefined && citys1[2] != undefined) {
                            this.selectedOptions1 = [citys1[0], citys1[1], citys1[2]];
                        } else if (citys1[0] != undefined && citys1[1] != undefined && citys1[2] == undefined) {
                            this.selectedOptions1 = [citys1[0], citys1[1], '全部'];
                        } else if (citys1[0] != undefined && citys1[1] == undefined && citys1[2] == undefined) {
                            this.selectedOptions1 = [citys1[0], '全部', '全部'];
                        }
                    } else {
                        this.selectedOptions1 = [];
                    }
                    if (response.data.user.kzWantcity2 != '') {
                        let reg = /.+?(省|市|自治区|自治州|县|区)/g;
                        let city2 = response.data.user.kzWantcity2;
                        let citys2 = city2.match(reg);
                        if (citys2[0] != undefined && citys2[1] != undefined && citys2[2] != undefined) {
                            this.selectedOptions2 = [citys2[0], citys2[1], citys2[2]];
                        } else if (citys2[0] != undefined && citys2[1] != undefined && citys2[2] == undefined) {
                            this.selectedOptions2 = [citys2[0], citys2[1], '全部'];
                        } else if (citys2[0] != undefined && citys2[1] == undefined && citys2[2] == undefined) {
                            this.selectedOptions2 = [citys2[0], '全部', '全部'];
                        }
                    } else {
                        this.selectedOptions2 = [];
                    }
                }
                if (response.data.user.kzVoucherPic == '暂无') {
                    this.fileList = [];
                } else if (response.data.user.kzVoucherPic == '') {
                    this.fileList = [];
                } else {
                    this.form.kzVoucherPic = response.data.user.kzVoucherPic;
                    response.data.user.kzVoucherPic.split(',').forEach(item => {
                        let Object = {
                            name: '',
                            url: ''
                        }
                        Object.name = item.slice(item.lastIndexOf('/') + 1);
                        Object.url = item;
                        this.fileList.push(Object)
                    })
                }
            });
        },
        /** 提交按钮 */
        submitForm() {
            this.$refs["form"].validate(valid => {
                if (valid) {
                    if (this.form.kzId != null) {
                        if (this.quanxian == true) {
                            this.form.kzWantcity = '';
                        }
                        change(this.form).then(response => {
                            this.lock=true;
                            if (response.code == 200) {
                                this.lock = false;
                                this.$modal.msgSuccess(response.msg);
                                this.open = false;
                                this.getList();
                                this.selectedOptions = [];
                                this.selectedOptions1 = [];
                                this.selectedOptions2 = [];
                            } else {
                                this.lock = false;
                                this.$modal.msgError(response.msg);
                            }
                        });
                    } else {
                        this.form.kzFrom = '后台录入';
                        insertZkwlResourcePC(this.form).then(response => {
                            this.lock = true;
                            if (response.data.code == 200) {
                                this.lock = false;
                                this.$modal.msgSuccess(response.data.msg);
                                this.open = false;
                                this.getList();
                                this.selectedOptions = [];
                                this.selectedOptions1 = [];
                                this.selectedOptions2 = [];
                                this.fileList = [];
                            } else {
                                this.lock = false;
                                this.$modal.msgError(response.data.msg);
                            }
                        });
                    }
                }
            });
        },
        // 分配商家
        kzfenpeishangjia(row) {
            // let aa = row.wantcity.split(',');
            // let bb = aa[0].split('-');
            // if (bb[1] == '全部') {
            //     row.wantcity = bb[0];
            // } else if (bb[2] == '全部') {
            //     row.wantcity = bb[0] + bb[1];
            // } else {
            //     row.wantcity = bb[0] + bb[1] + bb[2]
            // }
            // this.$router.push({
            //     name: "kzfenpeishangjia",
            //     query: { wantcity: row.wantcity, servetype: row.servetype, kzid: row.kzid },
            // });
            this.drawer = true;
            this.allocationShopQuery.kzid = row.kzid;
            this.allocationShopQuery.servetype = row.servetype;
        },
        // 有效审核
        youxiaoshenhe(row) {
            this.drawer1 = true
            this.reset();
            findOneKz({ kzid: row.kzid }).then(response => {
                this.shform.kzId = response.data.user.kzId;
                this.shform.serveType = response.data.user.serveType;
                this.shform.kzTel = response.data.user.kzTel;
                this.shform.kzWechat = response.data.user.kzWechat;
                this.shform.kzFrom = response.data.user.kzFrom;
                this.shform.kzWedding = response.data.user.kzWedding;
                this.shform.kzName = response.data.user.kzName;
                this.shform.kzRemark = response.data.user.kzRemark;
                this.open4 = true;
                this.title4 = "审核客资";
                if (response.data.user.kzWantcity != '') {
                    let reg = /.+?(省|市|自治区|自治州|县|区)/g;
                    let str = response.data.user.kzWantcity;
                    if (str.indexOf('-') == 3) {
                        str = str.split('-').join('');
                    }
                    let cc = str.match(reg);
                    if (cc[0] != undefined && cc[1] != undefined && cc[2] != undefined) {
                        this.selectedOptions = [cc[0], cc[1], cc[2]];
                        this.shform.kzWantcity = cc[0] + '-' + cc[1] + '-' + cc[2];
                    } else if (cc[0] != undefined && cc[1] != undefined && cc[2] == undefined) {
                        this.selectedOptions = [cc[0], cc[1], '全部'];
                        this.shform.kzWantcity = cc[0] + "-" + cc[1] + '-' + "全部";
                    } else if (cc[0] != undefined && cc[1] == undefined && cc[2] == undefined) {
                        this.selectedOptions = [cc[0], '全部', '全部'];
                        this.shform.kzWantcity = cc[0] + "-" + '全部' + '-' + '全部';
                    } else {
                        this.selectedOptions = [];
                    }
                } else {
                    this.selectedOptions = [];
                }
                if (response.data.user.kzWantcity1 != '') {
                    let reg = /.+?(省|市|自治区|自治州|县|区)/g;
                    let str = response.data.user.kzWantcity1;
                    let cc = str.match(reg);
                    if (cc[0] != undefined && cc[1] != undefined && cc[2] != undefined) {
                        this.selectedOptions1 = [cc[0], cc[1], cc[2]];
                        this.shform.kzWantcity1 = cc[0] + '-' + cc[1] + '-' + cc[2];
                    } else if (cc[0] != undefined && cc[1] != undefined && cc[2] == undefined) {
                        this.selectedOptions1 = [cc[0], cc[1], '全部'];
                        this.shform.kzWantcity1 = cc[0] + '-' + cc[1] + '-' +"全部";
                    } else if (cc[0] != undefined && cc[1] == undefined && cc[2] == undefined) {
                        this.selectedOptions1 = [cc[0], '全部', '全部'];
                        this.shform.kzWantcity1 = cc[0] + "-" + '全部' + '-' + '全部';
                    } else {
                        this.selectedOptions1 = [];
                    }
                } else {
                    this.selectedOptions1 = [];
                }
                if (response.data.user.kzWantcity2 != '') {
                    let reg = /.+?(省|市|自治区|自治州|县|区)/g;
                    let str = response.data.user.kzWantcity2;
                    let cc = str.match(reg);
                    if (cc[0] != undefined && cc[1] != undefined && cc[2] != undefined) {
                        this.selectedOptions2 = [cc[0], cc[1], cc[2]];
                      this.shform.kzWantcity2 = cc[0] + '-' + cc[1] + '-' + cc[2];npm

                    } else if (cc[0] != undefined && cc[1] != undefined && cc[2] == undefined) {
                        this.selectedOptions2 = [cc[0], cc[1], '全部'];
                      this.shform.kzWantcity2 = cc[0] + '-' + cc[1] + '-' +"全部";

                    } else if (cc[0] != undefined && cc[1] == undefined && cc[2] == undefined) {
                        this.selectedOptions2 = [cc[0], '全部', '全部'];
                      this.shform.kzWantcity2 = cc[0] + "-" + '全部' + '-' + '全部';
                    } else {
                        this.selectedOptions2 = [];
                    }
                } else {
                    this.selectedOptions2 = [];
                }
                if (response.data.user.kzVoucherPic == '') {
                    this.fileList = [];
                } else {
                    this.shform.kzVoucherPic = response.data.user.kzVoucherPic;
                    response.data.user.kzVoucherPic.split(',').forEach(item => {
                        let Object = {
                            name: '',
                            url: ''
                        }
                        Object.name = item.slice(item.lastIndexOf('/') + 1);
                        Object.url = item;
                        this.fileList.push(Object)
                    })
                }
            });
        },
        // 审核
        shenhe() {
            if (this.shform.type == 1) {
                let city = this.shform.kzWantcity.split('-');
                if (city[1] == '全部') {
                    this.shform.kzWantcity = city[0];
                } else if (city[2] == '全部') {
                    this.shform.kzWantcity = city[0] + city[1];
                } else {
                    this.shform.kzWantcity = city[0] + city[1] + city[2];
                };
                youxiaoshenhe(this.shform).then(response => {
                  this.getList();
                  this.close();
                  this.handleClose1();
                })
            } else if (this.shform.remark == '') {
                this.$modal.msgError('请输入备注信息!');
            }else if (this.shform.type == 0 && this.shform.remark != '') {
                youxiaoshenhe(this.shform).then(res => {
                    this.getList();
                    this.close();
                    this.handleClose1();
                })
            }
        },
        // 服务城市
        handleChange(value) {
            this.form.kzWantcity = value[0] + value[1] + value[2];
        },
        handleChange1(value) {
            this.form.kzWantcity1 = value[0] + value[1] + value[2];
            if (value.length == 0) {
                this.form.kzWantcity1 = null; // 清空选中值
            }
        },
        handleChange2(value) {
            this.form.kzWantcity2 = value[0] + value[1] + value[2];
            if (value.length == 0) {
                this.form.kzWantcity2 = null; // 清空选中值
            }
        },

        //所在城市
        handleChangeInWantccity(value){
          console.log("意向城市"+value);
          this.form.kzInWantcity = value[0] + value[1] + value[2];
        },

        // 上传截图
        handleRemove(file, fileList) {
            this.fileList = fileList;
            let Alist = [];
            let List = [];
            this.fileList.forEach(item => {
                if (item != file) {
                    Alist.push(item)
                }
            })
            this.fileList = Alist;
            this.fileList.forEach(item => {
                if (item.response) {
                    List.push(item.response.data)
                } else {
                    List.push(item.url)
                }
            });
            this.form.kzVoucherPic = List.join(',')
        },
        handlePreview(response, file, fileList) {
            this.fileList = fileList;
            let List = [];
            this.fileList.forEach(item => {
                if (item.response) {
                    List.push(item.response.data)
                } else {
                    List.push(item.url)
                }
            });
            this.form.kzVoucherPic = List.join(',');
        },
        handleRemove1(file, fileList) {
            this.fileList = fileList;
            let Alist = [];
            let List = [];
            this.fileList.forEach(item => {
                if (item != file) {
                    Alist.push(item)
                }
            })
            this.fileList = Alist;
            this.fileList.forEach(item => {
                if (item.response) {
                    List.push(item.response.data)
                } else {
                    List.push(item.url)
                }
            });
            this.shform.kzVoucherPic = List.join(',')
        },
        handlePreview1(response, file, fileList) {
            this.fileList = fileList;
            let List = [];
            this.fileList.forEach(item => {
                if (item.response) {
                    List.push(item.response.data)
                } else {
                    List.push(item.url)
                }
            });
            this.shform.kzVoucherPic = List.join(',');
        },
        // 查看
        handlelook(row) {
            // if (this.quanxian == true) {
            //     if (row.allShopnamePuname[0].typename == '待领取') {
            //         this.open3 = false;
            //         this.$modal.msgError('请领取客资')
            //     } else {
            //         findOneKz({ kzid: row.kzid }).then(response => {
            //             if (response.code == 200) {
            //                 this.title3 = "查看"
            //                 this.open3 = true;
            //                 this.form = response.data.user;
            //                 if (response.data.user.kzWantcity != '') {
            //                     let city = response.data.user.kzWantcity;
            //                     let reg = /.+?(省|市|自治区|自治州|县|区)/g;
            //                     let citys = city.match(reg);
            //                     if (citys[0] != undefined && citys[1] != undefined && citys[2] != undefined) {
            //                         this.selectedOptions = [citys[0], citys[1], citys[2]];
            //                     } else if (citys[0] != undefined && citys[1] != undefined && citys[2] == undefined) {
            //                         this.selectedOptions = [citys[0], citys[1], '全部'];
            //                     } else if (citys[0] != undefined && citys[1] == undefined && citys[2] == undefined) {
            //                         this.selectedOptions = [citys[0], '全部', '全部'];
            //                     }
            //                 } else {
            //                     this.selectedOptions = [];
            //                 }
            //                 if (response.data.user.kzWantcity1 != '') {
            //                     let reg = /.+?(省|市|自治区|自治州|县|区)/g;
            //                     let city1 = response.data.user.kzWantcity1;
            //                     let citys1 = city1.match(reg);
            //                     if (citys1[0] != undefined && citys1[1] != undefined && citys1[2] != undefined) {
            //                         this.selectedOptions1 = [citys1[0], citys1[1], citys1[2]];
            //                     } else if (citys1[0] != undefined && citys1[1] != undefined && citys1[2] == undefined) {
            //                         this.selectedOptions1 = [citys1[0], citys1[1], '全部'];
            //                     } else if (citys1[0] != undefined && citys1[1] == undefined && citys1[2] == undefined) {
            //                         this.selectedOptions1 = [citys1[0], '全部', '全部'];
            //                     }
            //                 } else {
            //                     this.selectedOptions1 = [];
            //                 }
            //                 if (response.data.user.kzWantcity2 != '') {
            //                     let reg = /.+?(省|市|自治区|自治州|县|区)/g;
            //                     let city2 = response.data.user.kzWantcity2;
            //                     let citys2 = city2.match(reg);
            //                     if (citys2[0] != undefined && citys2[1] != undefined && citys2[2] != undefined) {
            //                         this.selectedOptions2 = [citys2[0], citys2[1], citys2[2]];
            //                     } else if (citys2[0] != undefined && citys2[1] != undefined && citys2[2] == undefined) {
            //                         this.selectedOptions2 = [citys2[0], citys2[1], '全部'];
            //                     } else if (citys2[0] != undefined && citys2[1] == undefined && citys2[2] == undefined) {
            //                         this.selectedOptions2 = [citys2[0], '全部', '全部'];
            //                     }
            //                 } else {
            //                     this.selectedOptions2 = [];
            //                 }
            //                 this.form.kzVoucherPic = response.data.user.kzVoucherPic;
            //                 if (response.data.user.kzRemark == '') {
            //                     this.form.kzRemark = "暂无"
            //                 }
            //                 if (response.data.user.kzVoucherPic == '' || response.data.user.kzVoucherPic == '暂无') {
            //                     this.fileList = [];
            //                 } else {
            //                     response.data.user.kzVoucherPic.split(',').forEach(item => {
            //                         let Object = {
            //                             name: '',
            //                             url: ''
            //                         }
            //                         Object.name = item.slice(item.lastIndexOf('/') + 1);
            //                         Object.url = item;
            //                         this.fileList.push(Object)
            //                     })
            //                 }
            //             }
            //         })
            //     }
            // } else {
            //     findOneKz({ kzid: row.kzid }).then(response => {
            //         if (response.code == 200) {
            //             this.title3 = "查看"
            //             this.open3 = true;
            //             this.form = response.data.user;
            //             if (response.data.user.kzWantcity != '') {
            //                 let city = response.data.user.kzWantcity;
            //                 // console.log(city);
            //                 if (city.indexOf('-') == 3) {
            //                     city = city.split('-').join('');
            //                     // console.log(city);
            //                 }
            //                 let reg = /.+?(省|市|自治区|自治州|县|区)/g;
            //                 let citys = city.match(reg);
            //                 if (citys[0] != undefined && citys[1] != undefined && citys[2] != undefined) {
            //                     this.selectedOptions = [citys[0], citys[1], citys[2]];
            //                 } else if (citys[0] != undefined && citys[1] != undefined && citys[2] == undefined) {
            //                     this.selectedOptions = [citys[0], citys[1], '全部'];
            //                 } else if (citys[0] != undefined && citys[1] == undefined && citys[2] == undefined) {
            //                     this.selectedOptions = [citys[0], '全部', '全部'];
            //                 }
            //             } else {
            //                 this.selectedOptions = [];
            //             }
            //             if (response.data.user.kzWantcity1 != '') {
            //                 let reg = /.+?(省|市|自治区|自治州|县|区)/g;
            //                 let city1 = response.data.user.kzWantcity1;
            //                 let citys1 = city1.match(reg);
            //                 if (citys1[0] != undefined && citys1[1] != undefined && citys1[2] != undefined) {
            //                     this.selectedOptions1 = [citys1[0], citys1[1], citys1[2]];
            //                 } else if (citys1[0] != undefined && citys1[1] != undefined && citys1[2] == undefined) {
            //                     this.selectedOptions1 = [citys1[0], citys1[1], '全部'];
            //                 } else if (citys1[0] != undefined && citys1[1] == undefined && citys1[2] == undefined) {
            //                     this.selectedOptions1 = [citys1[0], '全部', '全部'];
            //                 }
            //             } else {
            //                 this.selectedOptions1 = [];
            //             }
            //             if (response.data.user.kzWantcity2 != '') {
            //                 let reg = /.+?(省|市|自治区|自治州|县|区)/g;
            //                 let city2 = response.data.user.kzWantcity2;
            //                 let citys2 = city2.match(reg);
            //                 if (citys2[0] != undefined && citys2[1] != undefined && citys2[2] != undefined) {
            //                     this.selectedOptions2 = [citys2[0], citys2[1], citys2[2]];
            //                 } else if (citys2[0] != undefined && citys2[1] != undefined && citys2[2] == undefined) {
            //                     this.selectedOptions2 = [citys2[0], citys2[1], '全部'];
            //                 } else if (citys2[0] != undefined && citys2[1] == undefined && citys2[2] == undefined) {
            //                     this.selectedOptions2 = [citys2[0], '全部', '全部'];
            //                 }
            //             } else {
            //                 this.selectedOptions2 = [];
            //             }
            //             this.form.kzVoucherPic = response.data.user.kzVoucherPic;
            //             if (response.data.user.kzRemark == '') {
            //                 this.form.kzRemark = "暂无"
            //             }
            //             if (response.data.user.kzVoucherPic == '' || response.data.user.kzVoucherPic == '暂无') {
            //                 this.fileList = [];
            //             } else {
            //                 response.data.user.kzVoucherPic.split(',').forEach(item => {
            //                     let Object = {
            //                         name: '',
            //                         url: ''
            //                     }
            //                     Object.name = item.slice(item.lastIndexOf('/') + 1);
            //                     Object.url = item;
            //                     this.fileList.push(Object)
            //                 })
            //             }
            //         }
            //     })
            // }
          findOneKz({ kzid: row.kzid }).then((response)=>{
            if (response.code == 200){
              this.form = response.data.user;
              this.kzStyleChange.style = response.data.user.rTypeId;
              this.kzStyleChange.kzId = response.data.user.kzId;
              this.kzStyleChange.remark = response.data.user.kzRemark;

            }
          });
          this.drawer2 = true;

          if (row.allShopnamePuname.length > 0){
            //获取当前客资的店铺集合
            this.thisKzShopList = row.allShopnamePuname;

            //客资当前在店铺的状态
            this.kzThisStyle = this.thisKzShopList[0].typename;
          }



          //获取分配商家集合
          this.allocationShopQuery.kzid = row.kzid;
          this.getAllocationShopList();

          //获取商家备注
          this.getShopKzLog(row.kzid);

          console.log("获取平台备注");
          //获取平台备注
          this.getPtKzChangeLog(row.kzid);

        },
      //商家备注
      getShopKzLog(kzId){
        getKzShopLog(kzId).then((response)=>{
          if (response.code == 200){
            this.shopKzLogMap = response.data;
          }
        })
      },

      //平台备注
      getPtKzChangeLog(kzId){
        getPtKzChangeLog(kzId).then((response)=>{
          if (response.code == 200){
            this.ptKzChangLog = response.data;
          }
        })
      },

      //判断客资状态
      checkKzType(value){
          console.log("客资状态"+value);
        for (let item of this.kzrType) {
          if (item.value == value){
            return item.label;
          }
        }
      },


      //分配商家方法
      // 服务城市
      changeAllocationShopQuery(aa) {
        this.allocationShopQuery.shopaddress = aa[0] + aa[1] + aa[2]
      },

      // 取消按钮操作
      resetAllocationShopQuery() {
        this.allocationShopQuery = {
          servetype: '',
          shopaddress: '',
          kzid: this.$route.query.kzid
        }
        this.selectedOptions = [];
        findAllShopa(this.allocationShopQuery).then(response => {
          this.shopList = response.data.shopname;
        })
      },
      //获取可分配的商家
      getAllocationShopList(){
        if (this.allocationShopQuery.shopaddress != '') {
          let str = this.allocationShopQuery.shopaddress;
          let reg = /.+?(省|市|自治区|自治州|县|区)/g;
          let bb = str.match(reg);
          if (bb[1] != undefined && bb[2] != undefined) {
            this.allocationShopQuery.shopaddress = bb[0] + bb[1] + bb[2];
          } else if (bb[1] != undefined && bb[2] == undefined) {
            this.allocationShopQuery.shopaddress = bb[0] + bb[1];
          } else if (bb[1] == undefined && bb[2] == undefined) {
            this.allocationShopQuery.shopaddress = bb[0];
          }
        }
        findAllShopa(this.allocationShopQuery).then(response => {
          this.allAllocationShop = response.data.shopname;
        })
      },

      // 客资分配商家
      kzAllocationShop(){
        if (this.num == undefined) {
          this.$modal.msgError('请先选择要处理的信息')
        } else {
          kzfenpeishangjia({ kzid: this.allocationShopQuery.kzid, num: this.num }).then(response => {
            if (response.code == 200) {
              this.drawer = false;
              this.$modal.msgSuccess("客资分配商家成功");
              this.$refs.multipleTable.clearSelection();
              this.getAllocationShopList();
              this.getList();
            }else{
              this.$modal.msgError(response.msg);
              this.lock = false;
            }
          })
        }
      },
        // 跟进记录
        handdleChakan(row) {
            this.open6 = true
            this.title5 = "跟进记录"
            selectjilu({ kzId: row.kzid, shopid: row.shopid }).then(response => {
                response.data.data.forEach(item => {
                    if (item.img != '') {
                        if (item.typeid == 2) {
                            this.imgsuodan = item.img.split(',');
                        } else if (item.typeid == 3) {
                            this.imgchengjiao = item.img.split(',');
                        } else if (item.typeid == 4) {
                            this.imgzhuanrang = item.img.split(',');
                        } else if (item.typeid == 5) {
                            this.imgfangqi = item.img.split(',');
                        } else if (item.typeid == 6 || item.typeid == 8 || item.typeid == 9) {
                            this.imgquxiao = item.img.split(',');
                        } else if (item.typeid == 10 || item.typeid == 11 || item.typeid == 12) {
                            this.imgtuihui = item.img.split(',');
                        } else if (item.typeid == 13) {
                            this.imgqxsuodan = item.img.split(',');
                        }
                    }
                });
                this.jiLuList = response.data.data;
            })
        },
        handleshop(shopid, row) {
            this.$router.push({
                name: 'shopkz',
                query: { kzId: row.kzid, shopid: shopid }
            })
        },
        looks(url) {
            this.srcList_s.push(url)
        },
        close() {
            this.reset();
        },
        handleExceed() {
            this.$modal.msgError('最多上传三张图片')
        },
        // 验证搜索框日期
        beginDate() {
            const self = this;
            return {
                disabledDate(time) {
                    //           debugger;
                    if (self.endTime) {
                        //如果结束时间不为空，则小于结束时间
                        return new Date(self.endTime).getTime() < time.getTime();
                    } else {
                        return time.getTime() > Date.now()//开始时间不选时，结束时间最大值小于等于当天
                    }
                },
            };
        },
        processDate() {
            const self = this;
            return {
                disabledDate(time) {
                    if (self.startTime) {
                        //如果开始时间不为空，则结束时间大于开始时间
                        return new Date(self.startTime).getTime() > time.getTime();
                    } else {
                        return time.getTime() > Date.now()//开始时间不选时，结束时间最大值小于等于当天
                    }
                },
            };
        },
        look(row) {
            this.srcList_L = row.kzVoucherPic;
        },
        // // 导出
        handleExport() {
            if (this.queryParams.startTime != '' && this.endTimes != "" && this.queryParams.startTime <= this.endTimes) {
                this.queryParams.endTime = this.endTimes + 24 * 60 * 60 * 1000 - 1;
            }
            const queryParams = this.queryParams;

            ExcelstAllkzs(queryParams).then(response => {
                if (response.code == 200) {
                    this.$modal.msgSuccess(response.msg);
                }
            });
        },
        /** 导入按钮操作 */
        handleImport() {
            this.upload.title = "客资导入";
            this.upload.open = true;
        },
        /** 下载模板操作 */
        importTemplate() {
            importTemplate().then(response => {
                this.$download.name(response.msg);
            })
        },
        // 文件上传中处理
        handleFileUploadProgress(event, file, fileList) {
            this.upload.isUploading = true;
        },
        // 文件上传成功处理
        handleFileSuccess(response, file, fileList) {
            this.upload.open = false;
            this.upload.isUploading = false;
            this.$refs.upload.clearFiles();
            this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
            this.getList();
        },
        // 提交上传文件
        submitFileForm() {
            this.$refs.upload.submit();
        },
        // 时间戳转时间
        timestampToTime(timestamp, state) {
            let now = new Date(timestamp),
                y = now.getFullYear(),
                m = now.getMonth() + 1,
                d = now.getDate();
            if (state == 0) {

            } else {
                return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + now.toTimeString().substr(0, 8);
            }
        },
        //  客户状态
        zhaungtai(val) {
            if (val == 0) {
                return "待领取"
            } else if (val == 1) {
                return "已领取"
            } else if (val == 2) {
                return "活动锁单"
            } else if (val == 3) {
                return "订单成交"
            } else if (val == 4) {
                return "转让客资"
            } else if (val == 5) {
                return "放弃客资"
            } else if (val == 6) {
                return "取消订单申请"
            } else if (val == 8) {
                return "取消订单成功"
            } else if (val == 9) {
                return "取消订单失败"
            } else if (val == 10) {
                return "客资退回申请"
            } else if (val == 11) {
                return "客资退回成功"
            } else if (val == 12) {
                return "客资退回失败"
            } else if (val == 13) {
                return "取消活动锁单"
            }
        },
        look2(img1) {
            this.srcList2.push(img1);
        },
        look4(img2) {
            this.srcList2.push(img2);
        },
        look5(img3) {
            this.srcList2.push(img3);
        },
        look6(img4) {
            this.srcList2.push(img4);
        },
        look7(img5) {
            this.srcList2.push(img5);
        },
        look8(img6) {
            this.srcList2.push(img6);
        },
        look9(img7) {
            this.srcList2.push(img7);
        },
        handleClose() {
            this.drawer = false;
            this.allocationShopQuery = {
              servetype: "",
              shopaddress: "",
              kzid: "",
            };
          this.selectedOptions = [];
          this.getAllocationShopList();
        },
        handleClose1() {
            this.drawer1 = false;
            this.reset();
        },
        handleClose2() {
            this.drawer2 = false;
            this.getList();
            this.reset();
            this.editStatus = 0;
            this.editStatus1 = 0;
            this.kzStyleChange = {
              kzId:"",
              shopId:[],
              style:"1",
              shopStyle:"1",
              flwType:"",//跟进方式
              remark:"",
            }
        },
        rowStyle1() {},
        handleSelectionChange3(selection) {
            selection.forEach((item) => {
                // this.searchdata.shopid = item.shopid;
            });
            // this.single = selection.length !== 1
            // this.multiple = !selection.length
        },
        handleEditStatus() {
            this.editStatus = this.editStatus == 0 ? 1 : 0;

            //修改客资信息
          if (this.editStatus == 0) {
            change(this.form).then(response => {
              if (response.code == 200) {
                this.$modal.msgSuccess(response.msg);
                this.selectedOptions = [];
                this.selectedOptions1 = [];
                this.selectedOptions2 = [];
              } else {
                this.lock = false;
                this.$modal.msgError(response.msg);
              }
            });
          }
          console.log("意向城市"+this.form.kzInWantCity);
        },
        handleEditStatus1() {
            this.editStatus1 = this.editStatus1 == 0 ? 1 : 0;
            if (this.editStatus1 == 0){
              console.log(this.kzStyleChange);
              changeKzStyle(this.kzStyleChange).then((respone)=>{
                if (respone.code == 100){
                  this.$modal.msgSuccess(response.msg);
                }
              });
              this.form.rTypeid = this.kzStyleChange.style;
              console.log(this.kzStyleChange.kzId);
              //刷新平台客资log
              this.getPtKzChangeLog(this.kzStyleChange.kzId);
              //刷新数据
              this.getShopKzLog(this.kzStyleChange.kzId);


            }
        },
        handleEditStatus2() {

        },
        handleSelectionChange3(selection) {
            selection.forEach((item) => {
                // this.searchdata.shopid = item.shopid;
            });
            // this.single = selection.length !== 1
            // this.multiple = !selection.length
            },
        handleClick(tab, event) {
            console.log(tab.index);
            this.tabIndex1 = tab.index
        },
        handleClick1(tab, event) {
            console.log(tab.index);
            this.tabIndex2 = tab.index
        },
      handleFPShopSelectionChange(selection){
        this.num = selection.map(item => item.shopid)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
        rowStyle1() {},
        choose_dm(num) {
            this.dm_num = num
            if(num == 3) {
                this.title7 = '有需求'
                this.open7 = true
            }
        },
        handleRemove2(file, fileList) {
            console.log(file, fileList);
        },
        handlePreview2(file) {
            console.log(file);
        }
    }
};
</script>
<style scoped>
.el-upload-list.el-upload-list--picture {
    display: none !important;
    /* 这里设置原有的缩略图视图影藏 */
}

.el-upload-list.el-upload-list--picture.show {
    display: block !important;
    /* 展示自己自定义的 */
}

.el-form {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.avatar-uploader .el-upload {
    border: 1px solid #8c939d;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.avatar-uploader .el-upload:hover {
    border-color: #409EFF;
}

.avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 78px;
    height: 78px;
    line-height: 78px;
    text-align: center;
    border: 1px solid #8c939d;
}

.avatar {
    width: 78px;
    height: 78px;
    display: block;
}

.drawer {
    width: 100%;
    height: 100%;
    position: relative;
}
.confirm {
    position: absolute;
    bottom: 15px;
    left: 20px;
}
.search_bar1 {
    width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 10px 15px;
  box-sizing: border-box;
}
.kz_name {
  display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
}
.kh_status {
  display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
}
.fp_time {
  display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
}
.mobile {
    display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
}
.tl_item {
  margin-bottom: 10px;
}
.basic_body {
    width: 480px;
    height: 220px;
    background: #F5F7FA;
    padding: 10px 20px;
    box-sizing: border-box;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}
.basic_info {
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
}
.basic_title {
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    margin-bottom: 20px;
}
.basic_item {
    width: 50%;
    display: flex;
    align-items: center;
}
.basic_text {
    font-size: 14px;
    color: #B0B3B8;
}
.basic_data {
    font-size: 14px;
    color: #4E5969;
}
.sh_body {
    width: 400px;
    margin-left: 40px;
    display: flex;
    flex-direction: column;
}
.sh_label {
    width: 90px;
    font-size: 14px;
    color: #333333;

}

.drawer {
    display: flex;
    width: 100%;
    height: 100%;
    /* position: relative; */
    .drawer_l {
        width: 780px;
        /* height: 100%; */
    }
    .drawer_r {
        width: 780px;
        /* height: 100%; */
    }
}
.basic_info {
    position: relative;
    .recharge {
        position: absolute;
        right: 10px;
        top: -10px;
    }
}

.basic_info_body {
    width: 760px;
    /* height: 220px; */
    background: #F5F7FA;
    padding: 10px 20px;
    box-sizing: border-box;
    font-size: 14px;
    color: #B0B3B8;
    margin: 0 auto;
}
.basic_title {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    box-sizing: border-box;
}
.confirm_text {
    font-size: 14px;
    color: #4E5969;
}
.row_group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 15px;
    .row_item {
        display: flex;
        align-items: center;
        width: 50%;
    }
}
.jd_type {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.level {
    display: flex;
    align-items: center;
    width: 50%;
}
.rank {
    display: flex;
    align-items: center;
    width: 50%;
}

.imgList {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}

.drawer_l {
    border-right: 1px solid #E5E6EB;
    padding: 0 10px 50px;
    box-sizing: border-box;
    height: 1050px;
    position: relative;
}
.drawer_r {
    /* border-right: 1px solid #E5E6EB; */
    padding: 0 10px 50px;
    box-sizing: border-box;
    height: 1050px;
}

::v-deep .el-timeline-item__timestamp {
    font-size: 16px!important;
    color: #4E5969!important;
}

.tl_title {
    font-size: 14px;
    color: #B0B3B8;
}
.tl_text {
    font-size: 14px;
    color: #4E5969;
}
.fl-center {
    display: flex;
    justify-content: center;
    align-items: center;
}
.sx {
    display: inline-block;
    padding: 5px;
    box-sizing: border-box;
    background-color: #23BB7B;
    border-radius: 8px;
}
.yxgj {
    position: absolute;
    right: 5px;
    top: 5px;
    font-size: 14px;
    color: #FF7D00;
    font-weight: 600;
}

.demand_group {
    position: absolute;
    right: 10px;
    top: 0;
    display: flex;
    /* justify-content: space-between; */
    align-items: center;
    .dm_btn {
        width: 70px;
        height: 28px;
        border-radius: 4px 4px 4px 4px;
        border: 1px solid #5672FA;
        font-size: 14px;
        color: #5672FA;
        margin-right: 10px;
        cursor: pointer;
        position: relative;
    }
}

.active_btn {
    background: #5672FA!important;
    border: none!important;
    font-size: 14px!important;
    color: #FFFFFF!important;
}
.dBody {
    width: 630px;
    height: 380px;
    background: #F5F7FA;
    padding: 10px 20px;
    box-sizing: border-box;

}
.dBody {
    display: flex;
    flex-direction: column;

}
.dRow {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.dItem {
    width: 50%;
    display: flex;
    align-items: center;
}
</style>
